For several months, the scripts are working fine...however due to some
hardware failure
we created a new server only last week on another linux machine which
we configured same as the old machine.

The only differrence is that we upgraded from Ubuntu 5.04 (the Hoary
hedgehog) to 5.10 (Breezy
Badger)...

On this i transferred my cron scripts and have done a series of
testing where i found no
problem at all..

But when i checked yesterday, my back-ups whch is located on another
harddrive and is mounted as /db,
contains nothing but the administrator and ITdept folders only, and
the rest, has not been backed-up.
Thinking that my backup harddisk maybe full that is why its not doing
its back-ups completely, so i created
a shell script whch i named homebu_(day).sh, and i put the following
scripts:

I tested again and, it works. But again when i checked it this
morning, the back up file has again the
administrator and ITdept folders only..i don't understand this..
when i run the df command, it returns:

my back up drive is 100% used, is this the reason? if it is then i
guess my approach to
solving it is not good at all.

Hope there could be someone who could explain further and help me
address
this problem...

thanks,
grace

10-01-2007, 12:28 AM

unix

Re: incomplete back-ups

grace <zympoul@gmail.com>:[color=blue]
>
> i've been creating back-ups of our files every night through cron jobs
> and my script
> for this is like this:
>
> 0 21 * * 1 sudo cp -r /home /db/home_bu/mon
> 0 21 * * 2 sudo cp -r /home /db/home_bu/tue
> ...
>
> For several months, the scripts are working fine...however due to
> [snip]
> The only differrence is that we upgraded from Ubuntu 5.04 (the
> Hoary hedgehog) to 5.10 (Breezy Badger)...
>
> On this i transferred my cron scripts and have done a series of
> testing where i found no problem at all..
>
> But when i checked yesterday, my back-ups whch is located on
> another harddrive and is mounted as /db, contains nothing but the
> administrator and ITdept folders only, and the rest, has not been
> backed-up. Thinking that my backup harddisk maybe full that is why
> [snip]
>
> rm -rf /db/home_bu/mon/
> mkdir /db/home_bu/mon/
> cd /
> sudo cp -r /home /db/home_bu/mon[/color]

If this is /etc/crontab, you're missing the field which says who to
run the script as:

0 21 * * 1 root /home/scripts/homebu_mon.sh
....................^^^^
[color=blue]
> I tested again and, it works. But again when i checked it this
> morning, the back up file has again the administrator and ITdept[/color]

Possible side-effect. If there's not enough space, it'll fail. As
well, if cron (or perhaps user "nobody"?) has no rights to look into
/home dirs which don't belong to it, it'll fail.
[color=blue]
> folders only..i don't understand this.. when i run the df command,
> it returns:
>
> Filesystem 1K-blocks Used Available Use% Mounted on
> /dev/mapper/Ubuntu-root 75175056 20823028 50533328 30% /
> [snip]
> /dev/hdc1 76920416 76920052 0 100% /db
>
> my back up drive is 100% used, is this the reason? if it is then i[/color]

Do that again after making space for your backups. Then run your
backup.
[color=blue]
> guess my approach to solving it is not good at all.[/color]

It's a little simplistic, but simple's good. It's got some kinks to
work out, is all. You might consider using a real archiver which can
do compression. That'll save you quite a bit of space. Eg.:

That last one uses bzip2 compression, and doesn't compress anything
less than 3 Kb (for performance). It's also smart enought to
recognize file types that are already compressed, so not bother trying
to compress them again.

so the resultant copies will have the same ownerships, protections,
and timestamps as the originals. This is very important should you
ever get into doing incremental backups (another way to minimize the
size of the resultant backup archive).