Re: backup script partly fails when in cron.weekly



Ok, first: Why it doesn't work I simply don't know.

You should test if this is a problem with find, or the egrep command,
cpio or cat by making verbose output into a own log file.

But maybe you should not use this (in my opinion) unusual command "find
/ -print ...". Instead use tar, like:

tar -zcvf /media/mirror/`date +%F`.tar.gz -C / --exclude=/media/*
--exclude=/proc/* --exclude=/sys/* --exclude=/mnt/*
(please test this first before going productive)

or use rsync. You will find a lot of examples in our great? world.

Best regards,
Benjamin Schmidt


Haines Brown wrote:
I asked this question some time ago. I've a script in /etc/cron.weekly
named "backup" (rwxr-xr-x root/root) that looks like this:

#!/bin/sh
mount /media/mirror
dirName=`date +%F`
mkdir /media/mirror/"$dirName"
find / -print | egrep -v "^/media|^/proc|^/sys|^/mnt" | cpio -pdmuv \
/media/mirror/"$dirName" 2>&1 | cat -vt
umount /media/mirror
exit 0

I regularly get only partial backups when run by cron, but full
backups if run from command line by root.

For example, in / I have two symlinks. Both are rwxrwxrwx root/root,
but only one gets backed up.

Another example, /home gets backed up, but /etc does not, even though
both are rwxr-xr-x root/root,

Yet another example: In / I have two plain text files, both are
rw-r--r-- root/root, but only one gets backed up.

Plenty of room on the backup device (external UPS drive). My syslog
reports the backup started. No other log entries of interest:

Dec 9 04:00:01 teufel /USR/SBIN/CRON[23041]:
(brownh) CMD (/home/brownh/scripts/backup)
Dec 9 04:00:01 teufel /USR/SBIN/CRON[23043]: (brownh) CMD (fetchmail)
Dec 9 04:00:01 teufel kernel:
kjournald starting. Commit interval 5 seconds
Dec 9 04:00:01 teufel kernel: EXT3-fs warning: maximal mount count
reached, running e2fsck is recommended
Dec 9 04:00:01 teufel kernel: EXT3 FS on sdd1, internal journal
Dec 9 04:00:01 teufel kernel: EXT3-fs: mounted filesystem with
ordered data mode.
Dec 9 04:00:01 teufel identd[23056]: started



--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages

  • Re: Simultaneous operation of two tape drives -- possible?
    ... I actually run my backups from a batch file (including ... If you invoke a program from the command line, all you have to do open a new command prompt window and invoke the program again in that window and you have two separate execution instances of the program running simultaneously, and independently as far as the operating system is concerned. ... If you invoke the program by double clicking on a program object, you can configure the object to achieve the same effect by right clicking on it and opening the properties notebook, going to the window tab and selecting "Create new window" under "Object open behavior." ...
    (comp.os.os2.setup.storage)
  • Re: vista backup restore
    ... virtual pc is installed and try out the command that i have provided below. ... > Should I install virtual server? ... >> backups done and the files within it -- is wiped out. ... >> coming to restore files from complete pc - were you able to restore>> the ...
    (microsoft.public.windows.vista.file_management)
  • Re: "tar" command has error messages.
    ... stops 2048 bytes short of the maximum allowed is due to the tar command ... > In case tar isn't largefile aware but the shell is, ... > If neither of those works, you could of course upgrade. ... > backups until you get the chance to upgrade, ...
    (comp.unix.admin)
  • Re: "tar" command has error messages.
    ... stops 2048 bytes short of the maximum allowed is due to the tar command ... > In case tar isn't largefile aware but the shell is, ... > If neither of those works, you could of course upgrade. ... > backups until you get the chance to upgrade, ...
    (comp.unix.solaris)
  • Re: "tar" command has error messages.
    ... stops 2048 bytes short of the maximum allowed is due to the tar command ... > In case tar isn't largefile aware but the shell is, ... > If neither of those works, you could of course upgrade. ... > backups until you get the chance to upgrade, ...
    (comp.sys.sun.admin)