Skip file when use tar
I want to use "tar" to backup some files from system , that includes some files & directory ( /usr /var /home ) , if I want to skip to tar a specific files & directory , can advise what can i do ? thx
|
--exclude
is one way See man tar for that You can also select files with find, etc and pipe the output to tar. How you will do it depends a bit on the proportion of included to excluded files in a given directory tree. Perhaps you could give a bit more colour on what you are trying to do. |
As "billymayday" mentioned find will help you to specify the files or directories
here are some samples to use tar and find Compress 30 days old files in current directory #find . –type f –atime + 30 | xargs tar czvf name.tar.gz Or #tar czvf name.tar.gz ‘find . –type f –atime +30’ |
Have you tried that first entry? I'd have thought you needed to use -r (append) to an existing file. Not sure though.
|
All times are GMT -5. The time now is 06:51 PM. |