Backups using Linux bash scripts
Posted: Fri Feb 08, 2013 11:36 pm
Hi, all.
I have several Linux distros spread over three disks that I backup using
bash scripts. The target drive (containing the backups) is in an
external enclosure that is hooked up to my PC using an eSATA connection.
Normally, that drive is powered off. But when I want to run backups,
I turn it on at boot time and using BIBM, boot a Linux distro (a tweaked
Puppy Linux right now) that has IFL installed in it.
Occasionally, when I turn on the external drive, my BIOS rearranges the
hard drive order so the drive order is not predictable. Using the blkid
and 'findfs UUID=' commands, I can identify the correct device name
(like /dev/sdb5) of a desired partition. Here lies my problem.
Looking at the IFL manual, I can specify the source drive using the
--d:/dev/xxx@p parameter. I can strip out the /dev/sdb portion of the
device ID but how do I get the partition ID / volume ID (the @p stuff
just mentioned?) I can use the manual IFL GUI and visually get the
numbers from the screen but I would like to script the whole process.
Stating the source partition as /dev/sdb5, for example, would nail the
desired volume but IFL doesn't like that format.
Is there another bash command that gets me the 2 or 4 character
partition/volume ID so I can build the imagel command line? Or better
yet, (this is for you, TBU ) can the Linux use of –d:/dev/xxx be
modified to include the volume number (like /dev/sdb5) instead of having
to use the @p parameter?
I want to use this script so I can do full monthly backups and periodic
differential backups in “fire and forget” mode.
Thanks for putting up with this long message. Hopefully, the answer is
short and sweet and within the confines of bash.
All the best,
George
--
There are 10 kinds of people in the world,
Those who understand binary,
and those who don't.
I have several Linux distros spread over three disks that I backup using
bash scripts. The target drive (containing the backups) is in an
external enclosure that is hooked up to my PC using an eSATA connection.
Normally, that drive is powered off. But when I want to run backups,
I turn it on at boot time and using BIBM, boot a Linux distro (a tweaked
Puppy Linux right now) that has IFL installed in it.
Occasionally, when I turn on the external drive, my BIOS rearranges the
hard drive order so the drive order is not predictable. Using the blkid
and 'findfs UUID=' commands, I can identify the correct device name
(like /dev/sdb5) of a desired partition. Here lies my problem.
Looking at the IFL manual, I can specify the source drive using the
--d:/dev/xxx@p parameter. I can strip out the /dev/sdb portion of the
device ID but how do I get the partition ID / volume ID (the @p stuff
just mentioned?) I can use the manual IFL GUI and visually get the
numbers from the screen but I would like to script the whole process.
Stating the source partition as /dev/sdb5, for example, would nail the
desired volume but IFL doesn't like that format.
Is there another bash command that gets me the 2 or 4 character
partition/volume ID so I can build the imagel command line? Or better
yet, (this is for you, TBU ) can the Linux use of –d:/dev/xxx be
modified to include the volume number (like /dev/sdb5) instead of having
to use the @p parameter?
I want to use this script so I can do full monthly backups and periodic
differential backups in “fire and forget” mode.
Thanks for putting up with this long message. Hopefully, the answer is
short and sweet and within the confines of bash.
All the best,
George
--
There are 10 kinds of people in the world,
Those who understand binary,
and those who don't.