Performance Checklist
In this lab, students will use rsync, scp, and tar to archive and back up folder contents.
Outcomes
Students will synchronize a remote folder to a local directory; an archive is then created with the synchronized folder as content; the archive gets copied to the remote machine and extracted to a newly created directory.
Reset your serverX system.
Synchronize the /etc directory tree on serverX to the /configsync directory on desktopX.
To be able to create the target directory /configsync, switch to the root user account using su.
[student@desktopX ~]$su -Password:redhat[root@desktopX ~]#
Create the target directory for the configuration files on desktopX.
[root@desktopX ~]#mkdir /configsync
Use the rsync command to synchronize the /etc directory tree on serverX to the /configsync directory on desktopX. Be aware that only the root user can read all the content in the /etc directory on serverX.
[root@desktopX ~]#rsync -av root@serverX:/etc /configsync...
On desktopX, create an archive named /root/configfile-backup-serverX.tar.gz with the /configsync directory as content, and copy the archive to the /root directory on serverX for backup purposes with the scp command.
Store the /configsync directory in the /root/configfile-backup-serverX.tar.gz archive.
[root@desktopX ~]#tar czf /root/configfile-backup-serverX.tar.gz /configsync
Create a backup copy of the /root/configfile-backup-serverX.tar.gz on serverX
[root@desktopX configsync]#scp /root/configfile-backup-serverX.tar.gz root@serverX:/rootPassword:redhat...
To prepare the archived directory tree for comparison with the currently actively used configuration files on serverX, extract the contents of the /root/configfile-backup-serverX.tar.gz archive to the /tmp/savedconfig/ directory on serverX.
Connect to the serverX machine as root by using ssh.
[root@desktopX configsync]#ssh root@serverXPassword:redhat[root@serverX ~]#
Create the target directory /tmp/savedconfig/, where the contents of the /root/configfile-backup-serverX.tar.gz archive will be extracted.
[root@serverX ~]#mkdir /tmp/savedconfig
Change to the target directory /tmp/savedconfig/ on serverX.
[root@serverX ~]#cd /tmp/savedconfig[root@serverX savedconfig]#
Extract the contents of the /root/configfile-backup-serverX.tar.gz archive to the /tmp/savedconfig/ directory on serverX.
[root@serverX savedconfig]#tar xzf /root/configfile-backup-serverX.tar.gz