Total Pageviews

Tuesday, 22 June 2010

Back up your website Linux tar command

1.To backup a directory silently using tar

# tar cvf - /var/www/html 2> /dev/null | gzip -c > www-$(date +%d-%m-%Y).tar.gz


2. To restore the directory

# gunzip < www-22-06-2010.tar.gz | tar xvf - &> /dev/null



man tar

No comments: