LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   simple backup script needed (http://www.linuxquestions.org/questions/programming-9/simple-backup-script-needed-185160/)

ferret_dude 05-24-2004 07:00 AM

simple backup script needed
 
I need a simple script witch compress all files in a directory
The script should automatically sett the file name to the current date ,
After transferring the file to a remote server the script shall delete the tar.gz file it made

That is about it

Stig



keefaz 05-24-2004 07:46 AM

well, nothing complicated. for compress and date, use tar and...date.

for the remote serveur you have to precise the connection protocol if you want help for that

ferret_dude 05-24-2004 08:16 AM

what about giving a :newbie: an example of how the script may look like ?
the problem is how to insert the date into the filename . BTW i want it to be in MM/DD/YY format

keefaz 05-24-2004 08:32 AM

well here is a short example (do man date to fine tunning) :

today=`date +%m-%d-%y`
tar -c -z -f "$today.tar.gz" /your/dir/to/backup

Edit : I formated the date according to your wish (MM/DD/YY)



ferret_dude 05-24-2004 08:45 AM

Thanks alot :D i wil give it a try :)


All times are GMT -5. The time now is 11:30 AM.