Excluding a file when using pax
I am using pax to backup my files and need to exclude a couple of large files. The file names never change.
From reading the man pages i should use the -c operator but it doesn't give any examples. this is my best guess but it says i am using a invaild combination of w c and f pax -w -f test /root/code_samples -c /root/code_samples/phpMyAdmin-2.6.2.zip Does anyone know how to exclude a file?? thanks t |
I think pax could turn out to be a nice little gem and may have to check it out some more. :)
The man page can be a bit confusing for sure but here is an excellent article. The -c option is on page three and is used like this.... -c './Linux Stuff' where that is the directory which I don't want restored. http://www.onlamp.com/pub/a/bsd/2002...cs.html?page=1 Here is an example I used. Code:
# ls |
so the -c flag is only good for excluding a folder from being restored?
Not excluding it from being in the backup in the first place? |
That's what I gather so far. I'll have to do some more checking to see what other options there are but I don't think -c is used during save operations.
|
what i want to do it to backup a users site into a single file and then offer it back to them so that they can download it and save it. (Basically so they are ultimately responsible for the data and not me)
My users like many others are a bit thick and we have advertised as a 'no extra software required' websites. So i would like to avoid using a FTP client. It would be great if the user just clicks a link and off they go. Therefore i thought if i can backup /home/website1 and then copy that file to /home/website1/backup the users can download from /home/website1/backup directly (obviously with sufficent authentication) This leads to the problem that the next time the backup is run it will backup the backup. Because the user is downloading the backup file it is vital that it is as small as possible. |
Can specific file be removed from the backup file after creation??
|
Quote:
I don't know what all options you can use. |
the man reason i am doing this is because one of my users deleted all the products out of the database then phoned me asking what the undo command was. He wasn't happy when i said there wasn't one. I did have a backup but it was before he added 400 products, again he wasn't happy.
I am open to any and all suggestions thanks for your help |
Code:
find /path/to/dir -name "*" | grep -v "file_to_exclude" | pax -w -d -x ustar | bzip2 > name_of_tar.tar.bz2 |
Okay, here it is in more of a script format.
Code:
#!/bin/sh |
All times are GMT -5. The time now is 12:00 AM. |