Jump to content

Recommended Posts

Posted

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 :(

Posted

Charlie,I don't know the proper syntax to use, but this small program might do what you ask:FileBackupHope it helps,

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...