0% found this document useful (0 votes)
82 views

Backing Up Data - Tar and Rsync: Tsa2151 System Administration & Maintenance LAB 12

1. The document provides instructions for backing up data using the tar and rsync commands. It describes how to create a compressed tar archive of the /var/www/html directory called webserver-backup.tar.gz and view the contents of an archive. 2. It also describes how to use rsync to backup the /var/www/html directory to the home directory and a Windows machine, and how to show statistics. 3. Automating backups is covered with examples using rsync, at, and cron to schedule backups of the /var/www/html directory to run at a future time and on a monthly basis.

Uploaded by

Sloth 怠惰
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views

Backing Up Data - Tar and Rsync: Tsa2151 System Administration & Maintenance LAB 12

1. The document provides instructions for backing up data using the tar and rsync commands. It describes how to create a compressed tar archive of the /var/www/html directory called webserver-backup.tar.gz and view the contents of an archive. 2. It also describes how to use rsync to backup the /var/www/html directory to the home directory and a Windows machine, and how to show statistics. 3. Automating backups is covered with examples using rsync, at, and cron to schedule backups of the /var/www/html directory to run at a future time and on a monthly basis.

Uploaded by

Sloth 怠惰
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

TSA2151 SYSTEM ADMINISTRATION & MAINTENANCE

LAB 12

Name
Student ID
Group

Backing Up Data - Tar and Rsync


1. tar (i.e., tape archive) command is used to convert a group of files into an archive. Below are
tar command and their options
tar option(s) archive_name file_name(s)/dirs
Options
c - create a new backup archive.
v - verbose mode, tar will print what it's doing to the screen.
p - preserves the permissions of the files put in the archive
for restoration later.
z - compress the backup file with 'gzip' to make it smaller.
f <filename> - specifies where to store the backup
-t, --list list the contents of an archive
a) Create a backup or an archive of your web server folder /var/ww/html using tar
command. Use compression in your archive . Give the archive name as webserver-
backup.tar.gz.
b) View content of your archive or backup using suitable tar command / options

2. Using rsync with suitable options, copy and backup your files/folder as below.
a) Backup your web server directory /var/www/html to web-server-backup folder in
your home directory and show the statistic of the transaction. Use ls command to
view both directory contents after completing rsync task.
b) Backup your web server directory /var/www/html to your Windows machine in
Desktop/web-server-backup folder. Use MobaXTerm as rsync client and use
compression and show statistics for rsync.

Backup Tools and Automated Task.


3. Using rsync and at command with suitable options, copy and backup your files as
below.
a) Use at command to set the task on your current time + 5 minutes and in the
command use rsync to copy your web folder /var/www/html to your home
folder /home/username/backup-lab12.
b) View the at queue.
c) Show the final result/output using ls command in your home directory.
4. Create an automated backup of your web server directory /var/www/html using tar
and run at specific time using cron as below:

a) Create a backup script called backup.sh in your home directory. In the script, use
tar command to compress your /var/www/html as web-backup.tar.gz to
/tmp folder. Make your script executable chmod 755 backup.sh

b) Using crontab -e, write the cron job that execute the backup script on month of
Oct at specific time during your lab session so that you can view the output/result.

c) Show the result/output using ls -l command in /tmp folder.

Note:
 Save your Lab tutorial as Group-Lab12-ID-Name-.pdf and upload to Google Classroom.

You might also like