backup help needed please

backup help needed please

Post by Didier Wirot » Wed, 31 Oct 2001 02:14:18



Hey,
I would like to backup daily a directory called /var/CommuniGate (the file
permissions and user/group/owner info should stay)
Something like:
tar -cvf CommuniGate.tar /var/CommuniGate | gzip CommuniGate.tar
but
I would like to do it automatically and 7 days a week (this is not a
problem). The file "CommuniGate.tar.gz" created on Monday should be called
Monday.tar.gz, the file from Tuesday should be called Tuesday.tar.gz etc...
How can you do that in a shell script.

Thanks a lot
Didier

 
 
 

backup help needed please

Post by Dances With Cro » Wed, 31 Oct 2001 02:45:53


On Mon, 29 Oct 2001 18:14:18 +0100, Didier Wiroth staggered into the
Black Sun and said:

Quote:>I would like to backup daily a directory called /var/CommuniGate (the file
>permissions and user/group/owner info should stay)
>Something like:
>tar -cvf CommuniGate.tar /var/CommuniGate | gzip CommuniGate.tar
>but I would like to do it automatically and 7 days a week (this is not
>a problem). The file "CommuniGate.tar.gz" created on Monday should be
>called Monday.tar.gz, the file from Tuesday should be called
>Tuesday.tar.gz etc...  How can you do that in a shell script.

#!/bin/bash
tar czf /tmp/communigate.tgz /var/communigate
DAY=`date +'%A' `
mv -f /tmp/communigate.tgz /somewhere/$DAY.tgz

Run that from cron, probably not at 12:00 midnight, but 12:01 would be
OK.

--
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin /
http://www.brainbench.com     /  "He is a rhythmic movement of the
-----------------------------/    penguins, is Tux." --MegaHAL

 
 
 

backup help needed please

Post by Thaddeus L Olcz » Wed, 31 Oct 2001 03:56:30




>On Mon, 29 Oct 2001 18:14:18 +0100, Didier Wiroth staggered into the
>Black Sun and said:
>>I would like to backup daily a directory called /var/CommuniGate (the file
>>permissions and user/group/owner info should stay)
>>Something like:
>>tar -cvf CommuniGate.tar /var/CommuniGate | gzip CommuniGate.tar
>>but I would like to do it automatically and 7 days a week (this is not
>>a problem). The file "CommuniGate.tar.gz" created on Monday should be
>>called Monday.tar.gz, the file from Tuesday should be called
>>Tuesday.tar.gz etc...  How can you do that in a shell script.

>#!/bin/bash
>tar czf /tmp/communigate.tgz /var/communigate
>DAY=`date +'%A' `
>mv -f /tmp/communigate.tgz /somewhere/$DAY.tgz

>Run that from cron, probably not at 12:00 midnight, but 12:01 would be
>OK.

Make sure that another cron job is not running at the same time
( not a big problem, but it may make a mess of your archive ).

You can also do things differently, labeling the archives by the exact

date ( rather than Monday ). Possibly it would work better that way if
you have a tape drive automatically backup from the partition where
you store your archives. If you only want the last week archives still
stored on the drive then use logrotate to clean it up.

 
 
 

backup help needed please

Post by hairetik » Sun, 18 Nov 2001 12:40:25



Quote:> On Mon, 29 Oct 2001 18:14:18 +0100, Didier Wiroth staggered into the
> Black Sun and said:
> >I would like to backup daily a directory called /var/CommuniGate (the file
> >permissions and user/group/owner info should stay)
> >Something like:
> >tar -cvf CommuniGate.tar /var/CommuniGate | gzip CommuniGate.tar
> >but I would like to do it automatically and 7 days a week (this is not
> >a problem). The file "CommuniGate.tar.gz" created on Monday should be
> >called Monday.tar.gz, the file from Tuesday should be called
> >Tuesday.tar.gz etc...  How can you do that in a shell script.

> #!/bin/bash
> tar czf /tmp/communigate.tgz /var/communigate
> DAY=`date +'%A' `
> mv -f /tmp/communigate.tgz /somewhere/$DAY.tgz

#!/bin/bash
#

DAY=`date +'%A' `
tar czf /somewhere/${DAY}.tgz /var/communigate

# mv -f /tmp/communigate.tgz /somewhere/$DAY.tgz

--
 Any technology distinguishable from magic is insufficiently advanced.
     TopQuark Software & Serv.  Contract programmer, server bum.

 
 
 

1. Cron script needed to make backups - help please

Hello,
        I have just made my first complete backup of my Linux system.  I would
now like to set it up so that the system automatically backs up certain things
at timed intervals.  I am using Linux v. 1.1.94 on a Dell Pentium with an
Iomega 250 QIC-80 tape drive.  The machine functions mainly as a web server.
These web files are constantly being updated daily.  The web files reside
in /home/www  Therefore, I would like to create a cron job that backs up
just these files everynight at midnoght.  I also would like to backup the users
home directories once a week.  How would I set up my cron script to handle
this?  Also, how often do I have to change the tape.  Also, at each backup,
will the tape rewind and start at the beginning or will it just append this
night's backup to the previous one?  Sorry to appear so clueless.  Any help
would be greatly appreciated.  Thanx in advance.

--
___________________________________________________________________________
   _ _ _  _ _ _  _ _                                
  / _ _/ /_  _/ /   \  Carl J. DiGiorgio         "The reward for work well

2. question: failed to install linux(Fedora) on Compaq Presario 2100

3. Please Help. Need affordable, reliable Backup Solution

4. Code Page 852 and Euro sign

5. Decent backup software needed. Please help.

6. ISO9660 format reader

7. still need printer help please please please

8. IP-Masquerade problems w/ rlogin

9. Help still needed please, please, please...

10. HELP, Need help on Solaris 8, Please, Please

11. PLEASE PLEASE HELP Major problem with my SCSI & Redhat 5.0 PLEASE Help

12. Sendmail problems. Please please please please help!

13. NFS please help me please please please sniff