charlie Posted June 5, 2003 Share Posted June 5, 2003 I wish to make a tar file to back up the contents of a subdirectory, but I wish to omit one or two files. I used the -x switch to exclude the files, but it did not work. Can someone provide the correct syntax to solve my problem?Charlie Quote Link to comment Share on other sites More sharing options...
quint Posted June 5, 2003 Share Posted June 5, 2003 Charlie,I don't know the proper syntax to use, but this small program might do what you ask:FileBackupHope it helps, Quote Link to comment Share on other sites More sharing options...
Bruno Posted June 5, 2003 Share Posted June 5, 2003 CharlieLeaving files out of a compressed archive is done with --exclude !It is as follows, you have to cd to the directory first where the subdirectories are:< cd /usr >< tar -cvzf backup.tar.gz /local --exclude /bin >This will make a .tar.gz file named ¨backup.tar.gz¨ of your /usr/local directory leaving the /usr/local/bin directory out. For more info: < tar --help >< tar -cvzf backup.tar.gz /local /doc /etc /java /bin > or any other file you put after the name of the .tar.gz file will be included in the package, you can put as many as you want with just a space in between.( regular expressions do NOT work with tar ) Bruno Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.