Quick back up website

To quickly backup your public folder use the below:

tar -zcvf /home/protected/public-date +%Y%m%d.tar.gz /home/public/

What the above will do is, compress the files in home/public and place the archive in /home/protected folder.

If you’re using Amazon EC2, the below will help:

tar -zcvf /var/www/-date +%Y%m%d.tar.gz /var/www/html
This will compress the files in /var/www/html and place the archive in /var/www/ folder.

Advertisements