View previous topic :: View next topic |
Author |
Message |
BlinkEye Veteran
Joined: 21 Oct 2003 Posts: 1046 Location: Gentoo Forums
|
Posted: Sat Jun 11, 2005 9:37 pm Post subject: |
|
|
new version out: v.3.1.0.
see first post for the change log (quite a lot this time). _________________ Easily backup up your system? klick
Get rid of SSH Brute Force Attempts / Script Kiddies klick |
|
Back to top |
|
|
Master One l33t
Joined: 25 Aug 2003 Posts: 754 Location: Austria
|
Posted: Sun Jun 12, 2005 3:43 pm Post subject: |
|
|
BlinkEye wrote: | according to your find command you're lying |
BlinkEye, I am sorry, but I think I don't understand.
BlinkEye wrote: | where are these lines come from:
Code: | find "/usr/src/linux-2.6.11-gentoo-r9"; find "/home"; find "/root/.ccache"; |
you still have /home in your $custom_include_list. its a good point though, i might try to catch such issues from within the script. |
The intention is to make a full system backup including /usr/src/linux, /home and /root/.ccache, except /home/user/vmware/*
I looks to me, that the configuration is right, but nevertheless it tries to backup /home/user/vmware/*
Am I overseeing something? _________________ Las torturas mentales de la CIA |
|
Back to top |
|
|
Sheepdogj15 Guru
Joined: 07 Jan 2005 Posts: 430 Location: Backyard
|
Posted: Sun Jun 12, 2005 8:42 pm Post subject: |
|
|
i've noticed this too. if you have something in one of the include lists and yet are trying to exclude something within the include, the include will override the exclude.
i know because it set up to include /tmp, but i had the script building the tarball in /tmp/backup. i set it to exclude /tmp/backup, but i found it was still trying to back it up.
From what i can tell, anything that is not explicitely included or excluded is by default included into the tarball. so, the operative thing to do (unless Blinkeye finds a way to fix this) would be to just not explicitely include a folder where you are trying to exclude something within that folder.
the only problem here is that you may still find that you want to have the option to include something or not. _________________ Sheepdog
Why Risk It? | Samba Howto |
|
Back to top |
|
|
BlinkEye Veteran
Joined: 21 Oct 2003 Posts: 1046 Location: Gentoo Forums
|
Posted: Sun Jun 12, 2005 8:48 pm Post subject: |
|
|
i'm working on it. i got a version with this feature up but want to run a full test again. _________________ Easily backup up your system? klick
Get rid of SSH Brute Force Attempts / Script Kiddies klick |
|
Back to top |
|
|
BlinkEye Veteran
Joined: 21 Oct 2003 Posts: 1046 Location: Gentoo Forums
|
Posted: Mon Jun 13, 2005 3:47 pm Post subject: |
|
|
new version out: v.3.2.
It's now possible to add a folder to $custom_include_list while excluding a folder withing that folder.
Example:
Code: |
custom_include_list="/home/*"
custom_exclude_list="/home/foo/downloads"
custom_exclude_pattern="*.iso *.mp3"
|
now, if you choose to do a custom backup, you'll be asked to back up any folder within /home. if you say 'yes' for /home/foo it will nevertheless exclude /home/foo/downloads and any files ending with .iso and .mp3 as you specified these restrictions in $custom_exclude_list and $custom_exclude_pattern.
please report any issues/questions.
[EDIT]
new version out: v.3.3
* hard coded find and tar.
* routine to verify and possibly suggest a path to the commands if one can't be found.
* added parameters. as a default, the script does not show the files processed by tar on stdout but solely the error (quite useful). the old behaviour can be attained by executing the script
or Code: | mkstage4.sh --verbose |
* updated howto. some sections added, some changes made ... _________________ Easily backup up your system? klick
Get rid of SSH Brute Force Attempts / Script Kiddies klick |
|
Back to top |
|
|
kommissar Tux's lil' helper
Joined: 19 May 2005 Posts: 78
|
Posted: Wed Jun 15, 2005 3:06 am Post subject: Thumbs Up. |
|
|
I just wanted to leave this post (six pages down) to let you know that this is a great tool; I've often wondered if I could just bzip my system. I intend to use it and tell my friends about it. Keep up the good work! |
|
Back to top |
|
|
troyboy162 n00b
Joined: 20 Dec 2004 Posts: 33 Location: Fort Drum NY
|
Posted: Wed Jun 15, 2005 3:22 am Post subject: |
|
|
great script!!!! i have a identical system to my freind and we stole his install with your script and dumped it on my comp quite easily.
i am having one problem... i get the "unable to open an intial console" message right before it turns on my swap partition. everything seems to work fine it just stops giving messages in the boot process and goes to gdm after a long pause where it would be normaly be spitting boot messages down the screen.
anyone else having this problem?
is there a cure?
for infos sake this is a 2005 amd64 install _________________ linux user# 212987
www.hippiekillers.com |
|
Back to top |
|
|
BlinkEye Veteran
Joined: 21 Oct 2003 Posts: 1046 Location: Gentoo Forums
|
Posted: Wed Jun 15, 2005 6:23 am Post subject: |
|
|
this sure sounds like an udev problem. which version of the script did you use? /dev/null and /dev/console are backed up since quite some time (these are two devices udev needs before initializing). For solving the problem see the gentoo udev guide.
in short
Code: | # mknod -m 660 console c 5 1
# mknod -m 660 null c 1 3
|
[EDIT] updated howto, added new section "3. Portability/Prerequesites"[/EDIT] _________________ Easily backup up your system? klick
Get rid of SSH Brute Force Attempts / Script Kiddies klick |
|
Back to top |
|
|
Jedidiah n00b
Joined: 16 Nov 2004 Posts: 13
|
Posted: Thu Jun 16, 2005 10:36 pm Post subject: |
|
|
Does anyone know will this work on a mac running OSX?
i have tried it on my linux machine, and i have need for a utility like this at work. the senario is this, we just got in 42 new macs that need to have identical setups, using the mac utils is out of the option becuase it takes way to long to transfer/copy the data from one machine to another. will this script work on a mac, so i can make one backup of the working machine and just unarchive it on everyother machine? will it work if i remove all of the folders from the default exclude list etc? I need to get a complete copy
thanks in advance |
|
Back to top |
|
|
troyboy162 n00b
Joined: 20 Dec 2004 Posts: 33 Location: Fort Drum NY
|
Posted: Thu Jun 16, 2005 10:53 pm Post subject: |
|
|
BlinkEye wrote: | this sure sounds like an udev problem. which version of the script did you use? /dev/null and /dev/console are backed up since quite some time (these are two devices udev needs before initializing). For solving the problem see the gentoo udev guide.
in short
Code: | # mknod -m 660 console c 5 1
# mknod -m 660 null c 1 3
|
[EDIT] updated howto, added new section "3. Portability/Prerequesites"[/EDIT] |
he used v3.0.0
i tryed the two commands you put and they didnt fix it. still its the only thing wrong with the install so i cant complain:) _________________ linux user# 212987
www.hippiekillers.com |
|
Back to top |
|
|
iverson0881 Apprentice
Joined: 08 Jan 2004 Posts: 285 Location: CA
|
Posted: Fri Jun 17, 2005 12:46 am Post subject: |
|
|
hmm i think your server links are down and i'm not if that is the latest version or the one embedded into the forum is the latest.
just thought you'd like to know.
EDIT: nevermind the one embedded into the site is the latest one. very nice script man!! thanks |
|
Back to top |
|
|
Pseud Apprentice
Joined: 19 Mar 2004 Posts: 273 Location: Bangalore, India
|
Posted: Fri Jun 17, 2005 4:41 am Post subject: |
|
|
Thanks for making our lives easy
Just have one question:
The script resulted in a ~1.7G tar.gz file. After "splitting" filename.tar.gz at the end, I'm left with filename.tar.gz and filename.tar.gz_a
Is this the way the split command works? I was expecting filename.tar.gz_a and filename.tar.gz_b
So, I don't know which comes first when i cat the files to merge them back later.
Thanks! _________________ eschew obfuscation |
|
Back to top |
|
|
BlinkEye Veteran
Joined: 21 Oct 2003 Posts: 1046 Location: Gentoo Forums
|
Posted: Sat Jun 18, 2005 8:48 am Post subject: |
|
|
Jedidiah wrote: | Does anyone know will this work on a mac running OSX?
i have tried it on my linux machine, and i have need for a utility like this at work. the senario is this, we just got in 42 new macs that need to have identical setups, using the mac utils is out of the option becuase it takes way to long to transfer/copy the data from one machine to another. will this script work on a mac, so i can make one backup of the working machine and just unarchive it on everyother machine? will it work if i remove all of the folders from the default exclude list etc? I need to get a complete copy
thanks in advance |
i don't see why it shouldn't work. i can't test it because i don't have a mac. removing the folder from the default exclude list is an option. _________________ Easily backup up your system? klick
Get rid of SSH Brute Force Attempts / Script Kiddies klick |
|
Back to top |
|
|
BlinkEye Veteran
Joined: 21 Oct 2003 Posts: 1046 Location: Gentoo Forums
|
Posted: Sat Jun 18, 2005 9:00 am Post subject: |
|
|
Pseud wrote: | Thanks for making our lives easy
Just have one question:
The script resulted in a ~1.7G tar.gz file. After "splitting" filename.tar.gz at the end, I'm left with filename.tar.gz and filename.tar.gz_a
Is this the way the split command works? I was expecting filename.tar.gz_a and filename.tar.gz_b
So, I don't know which comes first when i cat the files to merge them back later.
Thanks! |
command line:
Code: | cd /mnt/backups/stage4
split --suffix-length=1 --bytes=680m amd64-stage4-2005.06.14-minimal.tar.gz amd64-stage4-2005.06.14-minimal.tar.gz_ |
which resulted in: amd64-stage4-2005.06.14-minimal.tar.gz_a, amd64-stage4-2005.06.14-minimal.tar.gz_b. the original file wasn't removed. so, amd64-stage4-2005.06.14-minimal.tar.gz_a is the first one. what happens if you split it from the command line? are you sure you haven't set the --bytes=XXXm wrong? _________________ Easily backup up your system? klick
Get rid of SSH Brute Force Attempts / Script Kiddies klick |
|
Back to top |
|
|
Pseud Apprentice
Joined: 19 Mar 2004 Posts: 273 Location: Bangalore, India
|
Posted: Sat Jun 18, 2005 5:11 pm Post subject: |
|
|
BlinkEye,
I used the split command from inside the script (just uncommended it). I'll give it another shot and see what happens.
Meanwhile, I have another question/suggestion:
I saw the man page for the split command and there seems to be no option for not keeping the original file. This means if one intends to actually burn the backup onto CDs, just having to split the original into pieces will imply double the disk space requirement! (and this matters a lot for backups going into a few GBs). Is there a simple way around this? It would be great if the script itself could handle such a thing through an optional command line parameter ... generating a backup as a set of tar.gz files instead of one tar.gz file, each file limited to a reasonable size limit (like 690m, as you suggest). Is this do-able? _________________ eschew obfuscation |
|
Back to top |
|
|
bigmatt n00b
Joined: 30 Dec 2004 Posts: 13
|
Posted: Mon Jun 20, 2005 3:23 am Post subject: huh? |
|
|
umm I get this error when running the script
ERROR: /var/log/portage not found! Check your $default_include_files
and i dont really know what to do. |
|
Back to top |
|
|
BlinkEye Veteran
Joined: 21 Oct 2003 Posts: 1046 Location: Gentoo Forums
|
Posted: Mon Jun 20, 2005 4:54 am Post subject: |
|
|
just remove /var/log/portage from the $default_include_files. originally, it looked like:
Code: | # files/devices/folders, which need to be backed up (preserve folder structure).
# don't touch it unless you know what you are doing! no recursive backup of folders.
# use $default_include_folders instead.
default_include_files="
/dev/null
/dev/console
/mnt
/proc
/sys
/tmp
/usr/portage
/usr/src
/var/log/emerge.log
/var/log/portage" |
removing /var/log/portage results in:
Code: | # files/devices/folders, which need to be backed up (preserve folder structure).
# don't touch it unless you know what you are doing! no recursive backup of folders.
# use $default_include_folders instead.
default_include_files="
/dev/null
/dev/console
/mnt
/proc
/sys
/tmp
/usr/portage
/usr/src
/var/log/emerge.log" |
_________________ Easily backup up your system? klick
Get rid of SSH Brute Force Attempts / Script Kiddies klick |
|
Back to top |
|
|
bigmatt n00b
Joined: 30 Dec 2004 Posts: 13
|
Posted: Mon Jun 20, 2005 5:29 am Post subject: |
|
|
thanks alot worked fine . |
|
Back to top |
|
|
NightTwix n00b
Joined: 06 Jan 2005 Posts: 58
|
Posted: Mon Jun 20, 2005 12:01 pm Post subject: |
|
|
thanks BlinkEye, this script is really useful and works fine after little customiziation.
just a quick reminder to everyone:
be sure you doublecheck that your archive is not corrupted.
Especially when you copy it to a windows-box via Samba and burn it on CD.
I ended up with a corrupt archive somehow...
The best thing is to make a md5sum after each copy process and compare it to the original.
Maybe the script could automatically generate a md5sum after making the archive |
|
Back to top |
|
|
BlinkEye Veteran
Joined: 21 Oct 2003 Posts: 1046 Location: Gentoo Forums
|
Posted: Mon Jun 20, 2005 3:32 pm Post subject: |
|
|
well, the script verifies if tar/gzip/bzip creates a corrupted archive or not. i don't know why samba would cripple a file during transfer ...
either way, if you want a md5sum add
Code: | echo "* md5sum archive: `md5sum $stage4Name.$stage4postfix`" |
to the end of the script. _________________ Easily backup up your system? klick
Get rid of SSH Brute Force Attempts / Script Kiddies klick |
|
Back to top |
|
|
Jedidiah n00b
Joined: 16 Nov 2004 Posts: 13
|
Posted: Mon Jun 20, 2005 3:39 pm Post subject: |
|
|
BlinkEye wrote: | i don't see why it shouldn't work. i can't test it because i don't have a mac. removing the folder from the default exclude list is an option. |
BlinkEye - it took a little bit of playing around but i think i got the script to work, for a backup at least (it took nearly 2 hours to run the backup, on a fresh install). however, copying it over to another disk is another story, the first time i untarred it, it stalled out with an error along the lines of cannot copy simlink, file exists (i think that is the error, but i don't recall). I am currently trying to untarr it again to see if i get the same results, if i do i will post the exact error message
also, another question, in one of my tests i had added the /System /Application and /Library direcotries to the default_include_folders_list. when i did an interactive backup, it copied those directoried first, then i noticed that it seemed like it was copying them again later, is this the case, or was it just verrifying that it had already coppied them?
thanks |
|
Back to top |
|
|
Jedidiah n00b
Joined: 16 Nov 2004 Posts: 13
|
Posted: Mon Jun 20, 2005 4:10 pm Post subject: |
|
|
Ok it just errored out again running it on the mac, here is the error, any ideas how to overcome it?
Code: | tar: var: Cannot create symlink to `private/var': File exists
tar: Error exit delayed from previous errors |
i was going to try using the "-h" option when i untarred it, but i wasn't sure if that would mean that i would not have any symlinks then.
any suggestions?
jedidiah |
|
Back to top |
|
|
BlinkEye Veteran
Joined: 21 Oct 2003 Posts: 1046 Location: Gentoo Forums
|
Posted: Mon Jun 20, 2005 8:25 pm Post subject: |
|
|
Jedidiah wrote: | also, another question, in one of my tests i had added the /System /Application and /Library direcotries to the default_include_folders_list. when i did an interactive backup, it copied those directoried first, then i noticed that it seemed like it was copying them again later, is this the case, or was it just verrifying that it had already coppied them? thanks |
the idea about this $default_include_folders is to include folders listed in there and to make sure, they get backup-ed anyway. it happened that users added /var to the $default_exclude_list and hence portage's memory was wiped out (that's why /var/db and /var/cache/edb MUST be backup-ed). for your case, add /System, /Application and /Library additionally to the $default_exclude_list to prevent double backup.
Jedidiah wrote: | Ok it just errored out again running it on the mac, here is the error, any ideas how to overcome it?
Code: | tar: var: Cannot create symlink to `private/var': File exists
tar: Error exit delayed from previous errors |
|
did you first wipe out files/dirs on that partition you're trying to extract? if yes it may just be the behaviour explained above - a dir has been backup-ed twice and it now complains while extracting (which doesn't hurt).
on your previous post you said, that it takes two hours to make the stage4. if that's true this script is probably not the right thing for you as you are just backing up anything. the idea of this script is to exclude anything not necessary to save time and disk space. for this to work you need a thorough understanding of your system. well, you may use it either way or at least find use of the tar command. _________________ Easily backup up your system? klick
Get rid of SSH Brute Force Attempts / Script Kiddies klick |
|
Back to top |
|
|
Jedidiah n00b
Joined: 16 Nov 2004 Posts: 13
|
Posted: Mon Jun 20, 2005 9:37 pm Post subject: |
|
|
Thanks Blinkeye i added the /System /Library and /Applications folders to the default exclude list, i am running the command again so i will let you know in the morning weather or not it worked. the reason why i am using this script is because there seems to be a serious lack of tools for backing up an entire mac system (what i really need is an app that does what Norton Ghost does on the PC for a mac, this script is close enough). also, of the few apps that i have found, they all take just as long, if not longer, so the two hour thing seems to be a mac problem and not a problem with the script (a fresh install of osx 10.4 with microsoft office seems to take up roughly 26 gigs) so if you ask me, two hours to compress 26 gigs down to about 11 gigs isn't too bad (espesially in comparison with the two days it used to take on our os9 machines, now if it will only work)
thanks for your help, expect at least one more post from me tomorrow
jedidiah |
|
Back to top |
|
|
BlinkEye Veteran
Joined: 21 Oct 2003 Posts: 1046 Location: Gentoo Forums
|
Posted: Tue Jun 21, 2005 2:09 pm Post subject: |
|
|
Pseud wrote: | Meanwhile, I have another question/suggestion:
...
It would be great if the script itself could handle such a thing through an optional command line parameter ... generating a backup as a set of tar.gz files instead of one tar.gz file, each file limited to a reasonable size limit (like 690m, as you suggest). Is this do-able? |
good suggestion. it's done.
new version out: v.3.4
there's a new variable $split_options you may need/want to adjust. now, if you want to create a stage4 consisting of chunks the size you set in $split_options (instead of one big tarball) use the -s or --split parameter while calling the script:
Code: | ./mkstage4.sh --split
./mkstage4.sh -s |
this will prevent the script of first creating a huge tarball which you may need to split afterwards.
example: instead of a 2GB stage4.tar.gz you'll get (with default options and calling the script with --split/-s) 3 files:
stage4.tar.gz_a
stage4.tar.gz_b
stage4.tar.gz_c
[EDIT]fixed language[/EDIT] _________________ Easily backup up your system? klick
Get rid of SSH Brute Force Attempts / Script Kiddies klick
Last edited by BlinkEye on Fri Jul 01, 2005 5:25 am; edited 1 time in total |
|
Back to top |
|
|
|