Well, there are many ways to do this. For example, the following will
create the archive without copying the files to the temporary directory and
without creating the OF variable.
#!/bin/sh
tar cvzf /home/jon/backup-$(date +%m%d%Y).tar.gz --files-from - << _EOF_
/home/jon/.gaim/logs/
/home/jon/.netscape/bookmarks.html
/home/jon/.kde2/share/apps/konqueror/bookmarks.xml
/home/jon/.sylpheed/*.xml
home/jon/.sylpheed/accountrc
_EOF_
Avi
--On Tuesday, February 19, 2002 22:46:48 -0500 Jon Doe
I am just starting to make some simple bash scripts for my system. I have made a bash script to backup some files in my home directory and tar them, then remove the old files. This works fine, but I just wonder if there is a shorter/easier way to do this. Below is the script I made, any suggestions? Again this is working fine, I just wanted some input on easier/shorter ways to do this.
# !/bin/sh cp /home/jon/.gaim/logs/* /home/jon/backup/ cp /home/jon/.netscape/bookmarks.html /home/jon/backup/ cp /home/jon/.kde2/share/apps/konqueror/bookmarks.xml /home/jon/backup/ cp /home/jon/.sylpheed/*.xml /home/jon/backup/ cp /home/jon/.sylpheed/accountrc /home/jon/backup/ OF=/home/jon/backup-$(date +%m%d%Y).tar.gz tar -cZf $OF /home/jon/backup rm /home/jon/backup/* -- Avi Schwartz avi@CFFtechnologies.com
"I have to share the credit. I invented it, but Bill made it famous." - IBM engineer Dave Bradley describing the control-alt-delete reboot sequence