FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 01-25-2011, 06:31 AM
"madunix@gmail.com"
 
Default backup script

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.

Thanks
madunix
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-25-2011, 07:36 AM
Edo
 
Default backup script

Hi,

Try the ff:

On 1/25/11 4:31 PM, madunix@gmail.com 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

Yes, just use crontab for that. Something like,

30 6 * * * command-or-path-to-script-here

to run the command or script everyday 6:30 a.m.

> and to keep the last 5days backup on the
> box and remove older version than 5days.
> Can you point me out.

I think the easiest way is to use logrotate. man logrotate for details.

HTH,

--
- Edwin - mailto:ml2edwin@gmail.com
“Pleasant sayings are a honeycomb, sweet to the soul
and a healing to the bones.”—Proverbs 16:24
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 09:40 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org