Re: incomplete back-ups



grace <zympoul@xxxxxxxxx>:

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

All that blew away was the one day. What's in tue, wed, thu, ...? It
could be they're the ones that're filling (or mostly filling) /db.

..deleting first the existing back-up and creating a new one..

..and added to my crontab like this:
0 21 * * 1 /home/scripts/homebu_mon.sh
0 21 * * 2 /home/scripts/homebu_tue.sh
...

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
....................^^^^

I tested again and, it works. But again when i checked it this
morning, the back up file has again the administrator and ITdept

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.

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

Do that again after making space for your backups. Then run your
backup.

guess my approach to solving it is not good at all.

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.:

tar cvf /db/home_bu/20070619_home.tgz /home \
> /db/home_bu/20070619_home.log

or (my personal preference):

find /home -depth -mount -print0 | \
afio -z -Z bzip2 -v -T 3k \
-o /db/home_bu/20070619_home.afio \
-L /db/home_bu/20070619_home.log

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.

Keep banging your head on that wall. It'll fall over eventually. :-)


--
Any technology distinguishable from magic is insufficiently advanced.
(*) http://www.spots.ab.ca/~keeling Linux Counter #80292
- - http://www.faqs.org/rfcs/rfc1855.html Please, don't Cc: me.
.



Relevant Pages

  • Re: php zlib
    ... have been searching for a provider that allows zip compression through ... php scripts and now I have this instead. ... My goal is to be able to run a php script to compress and backup ... Spenlow, more like Punch than I had ever seen Jaimica, as Tremayne ...
    (comp.lang.php)
  • Re: Query regarding cron jobs
    ... The script is getting executed a few times when scheduled through cron ... The probability of successful execution is 6/10. ... showing any entries crontab -l as the entry in /etc/cron.d is for root ...
    (RedHat)
  • Re: Query regarding cron jobs
    ... The script is getting executed a few times when scheduled through cron ... The probability of successful execution is 6/10. ... showing any entries crontab -l as the entry in /etc/cron.d is for root ...
    (RedHat)
  • SUMMARY: cron entry: nth day of every month?
    ... cron can not handle this with its own syntax. ... 21st but "command" only runs if the output of the "date" command ... What I would suggest is rather than embedding the logic in each script ... The answer is it is _not_ possible to control it only with crontab ...
    (Tru64-UNIX-Managers)
  • Re: Cron Jobs
    ... > having a cron will mean yo server is forced by the script ... > best than allowing mail dequeing by connection. ... > host server so I can get emails for my domain example.com. ...
    (RedHat)