Re: backup script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



You could create a script and have a variable date --date="5 days ago" append to your tar file and after that, combine it with if syntax. If match, then rm.


HTH


On Tue, Jan 25, 2011 at 3:31 PM, madunix@xxxxxxxxx <madunix@xxxxxxxxx> wrote:
I want to create bash script to have a zip copy from a website running
on linux /var/www/htdocs/* local on the same box on different
directory
I am thinking to do a local backup using crontab (snapshot my web)
tar -cvzf /tmp/website-$(date +%Y%m%d-%H%M).tgz /var/www/htdocs/*
This command will create a file /tmp/website-20110101-1459.tgz
I want it run on daily basis and to keep the last 5days backup on the
box and remove older version than 5days.
Can you point me out.

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux