mcavic

msg:3797279 | 6:05 am on Dec 1, 2008 (gmt 0) |
If you want them all in the same gz file: tar -c website1 website2 whatever ¦ gzip -c > backups/archives/yourdomainname.com-$suffix.tar.gz |
| If you want them in different files, then just run a separate tar command for each one.
|
drooh

msg:3797283 | 6:20 am on Dec 1, 2008 (gmt 0) |
simple as that! thanks
|
drooh

msg:3797287 | 6:22 am on Dec 1, 2008 (gmt 0) |
would there be a way to specify all folders except certain ones? for instance everything but /badfiles/ ? This way if files are added to the domain the cron doesnt need to change /website1/ /website2/ /website3/ /somefiles/ /badfiles/
|
mcavic

msg:3797312 | 6:50 am on Dec 1, 2008 (gmt 0) |
Yep, try: tar -c -X badfiles *
|
drooh

msg:3797313 | 6:52 am on Dec 1, 2008 (gmt 0) |
would that be tar -c -X badfiles * website1 website2 whatever ¦ gzip -c > backups/archives/yourdomainname.com-$suffix.tar.gz
|
drooh

msg:3797315 | 6:53 am on Dec 1, 2008 (gmt 0) |
what if there were more than one folder you didnt want to include? tar -c -X badfiles morebadfiles * ?
|
mcavic

msg:3797330 | 8:12 am on Dec 1, 2008 (gmt 0) |
Hmm, the -X isn't working for me, but this should: tar -c --exclude badfile1 --exclude badfile2 * ¦ gzip -c > backups/archives/yourdomainname.com-$suffix.tar.gz |
| The * specifies all files and folders except the ones that were previously excluded. Keep in mind also that "backups" should be excluded, or it should be somewhere else so that it's not included in the backup.
|
drooh

msg:3797932 | 2:24 am on Dec 2, 2008 (gmt 0) |
that seems to work well with the --exclude what does the * mean? and in the previous example I had what does the nice -19 do ?
|
mcavic

msg:3797951 | 2:47 am on Dec 2, 2008 (gmt 0) |
The * specifies all files and folders. Nice 19 sets the backup to a low priority so that it doesn't use too much CPU time. If that's a concern, you'll need it before the gzip too, because gzip will be using most of the CPU time. | nice -19 tar -c --exclude badfile1 --exclude badfile2 * ¦ nice -19 gzip -c > backups/archives/yourdomainname.com-$suffix.tar.gz |
|
|
drooh

msg:3797963 | 2:57 am on Dec 2, 2008 (gmt 0) |
very good to know, are there any other useful options that i should be aware of?
|
mcavic

msg:3797970 | 3:07 am on Dec 2, 2008 (gmt 0) |
To see a list of files on the backup: gunzip -c backupfile.tar.gz ¦ tar tv To restore a specific file: gunzip -c backupfile.tar.gz ¦ tar xv website1/myfile.html To restore all files (and replace any existing files without asking): gunzip -c backupfile.tar.gz ¦ tar xv And if you're low on disk space, and your system has bzip2 installed, you can replace gzip with bzip2, replace gunzip with bunzip2, and replace .gz with .bz2. It'll take longer to run, but the backups should be a little smaller.
|
|