Click to See Complete Forum and Search --> : BackUp Script Question


jedicosmonaut
06-02-2003, 07:55 AM
I have a backup script that I'm using on Red Hat 9. The script is:

tar -u -f /home/bkp.jim.tar /home/jim

How do I ignore all of the hidden files? All of the files and folders that start with '.' should not be included. Any ideas? Thanks

chrism01
06-02-2003, 10:19 AM
Here's 3 ideas, BUT I haven't tried them.....
Take advantage of the fact that the basic ls cmd doesn't return hidden files and feed the results into tar eg

ls -1 | tar -u -f /home/bkp.jim.tar

or ls to a file and feed that in

tar -u -f /home/bkp.jim.tar <file.lst

or try looping


for file in `ls -1`
do
tar -u -f /home/bkp.jim.tar $file
done


Hope this gives you a few ideas..
Good luck