« IT » : différence entre les versions

De PN Wiki
Aller à la navigation Aller à la recherche
Ligne 12 : Ligne 12 :
== Migration of folders to a new server ==
== Migration of folders to a new server ==


rsync -av /root/ root@newice3:/root/ --delete
=== One shot ===


rsync -av /home/ root@newice3:/home/ --delete
rsync -av /var/db/ports/ root@newice3:/var/db/ports/ --dry-run


rsync -av /var/db/ports/ root@newice3:/var/db/ports/
rsync -av /etc/ root@newice3:/etc/oldice3 --delete --dry-run


rsync -av /var/www/ root@newice3:/var/www/ --delete
rsync -av /usr/local/etc/ root@newice3:/usr/local/etc/ --delete --dry-run


rsync -av /usr/local/www/ root@newice3:/usr/local/www/ --delete
rsync /etc/ssh/ssh_config /etc/ssh/sshd_config newice3:/etc/ssh/ --dry-run


rsync -av /usr/local/etc/ root@newice3:/usr/local/etc/ --delete
rsync /etc/banner /etc/motd.template newice3:/etc/ --dry-run


rsync -av /var/log/ root@newice3:/var/log/oldice3/ --delete
=== 1 full + diff at the migration time ===


rsync -av /etc/ root@newice3:/etc/oldice3 --delete
rsync -av /root/ root@newice3:/root/ --delete --dry-run


rsync -av /var/awstats/ root@newice3:/var/awstats/ --delete
rsync -av /home/ root@newice3:/home/ --delete --dry-run


rsync -av /var/log/www/ root@newice3:/var/log/www/ --delete
rsync -av /var/www/ root@newice3:/var/www/ --delete --dry-run


rsync /etc/ssh/ssh_config /etc/ssh/sshd_config newice3:/etc/ssh/
rsync -av /usr/local/www/ root@newice3:/usr/local/www/ --delete --dry-run


rsync /etc/banner /etc/motd.template newice3:/etc/
rsync -av /var/log/ root@newice3:/var/log/oldice3/ --delete --dry-run
 
rsync -av /var/awstats/ root@newice3:/var/awstats/ --delete --dry-run
 
rsync -av /var/log/www/ root@newice3:/var/log/www/ --delete --dry-run


= References =
= References =
{{references}}
{{references}}

Version du 5 décembre 2023 à 14:06

Named

Manually updating a Dynamic controlled zone

"If you have to edit the zone files of dynamic zones manually while the DNS server is running, you'll have to freeze the zones with # rndc freeze <myzone> before editing and unfreeze them with # rndc thaw <myzone> after editing. This is because named(8) has internal state information and external journal files attached to dynamic zones that have to be kept in sync with the zone files[1]".

Rsync

To delete files in the target if they disappeared from the source, then add the --delete option to your command. For example:

rsync -avh source/ dest/ --delete
NB: -avh is for --archive --verbose --human-readable[2].

Migration of folders to a new server

One shot

rsync -av /var/db/ports/ root@newice3:/var/db/ports/ --dry-run

rsync -av /etc/ root@newice3:/etc/oldice3 --delete --dry-run

rsync -av /usr/local/etc/ root@newice3:/usr/local/etc/ --delete --dry-run

rsync /etc/ssh/ssh_config /etc/ssh/sshd_config newice3:/etc/ssh/ --dry-run

rsync /etc/banner /etc/motd.template newice3:/etc/ --dry-run

1 full + diff at the migration time

rsync -av /root/ root@newice3:/root/ --delete --dry-run

rsync -av /home/ root@newice3:/home/ --delete --dry-run

rsync -av /var/www/ root@newice3:/var/www/ --delete --dry-run

rsync -av /usr/local/www/ root@newice3:/usr/local/www/ --delete --dry-run

rsync -av /var/log/ root@newice3:/var/log/oldice3/ --delete --dry-run

rsync -av /var/awstats/ root@newice3:/var/awstats/ --delete --dry-run

rsync -av /var/log/www/ root@newice3:/var/log/www/ --delete --dry-run

References