Goal
Move files between the two servers with scp, sftp and rsync, and plan a reboot with a warning to users.
Before you start
- Finish lab 5.1 first (key login from server1 to server2), or type the password when asked.
Tasks
Tick a task when it is done. Only your browser remembers it.
- Copy
/etc/hostsfrom server1 to/tmp/hosts-from-server1on server2 with scp. - Download
/etc/os-releasefrom server2 to your home folder on server1 with sftp. - On server1, create the folder
~/sitewith three files. Synchronize it to/home/student/site-backup/on server2 with rsync. - Delete one file in
~/siteand run the sync again so that the file is also removed on server2. First show what would happen without changing anything. - Plan a reboot of server2 in 10 minutes with the message "Kernel update". Then cancel it.
Check your work
- The removed file from task 4 is gone in
~/site-backupon server2. - After task 5,
ssh root@server2 'systemctl list-jobs'shows no pending reboot (or check the cancel message).
Hints
Show the hints
- The remote part of an scp path is
user@host:path. - In sftp,
getdownloads. - rsync: a slash at the end of the source copies the content;
-n= dry run;--deleteremoves extra files. shutdown -r +10 "message"andshutdown -c.
Solution
Show the solution
My notes
No notes yet.