Re: backup script partly fails when in cron.weekly

2007-12-12 Thread Haines Brown
Andrew Sackville-West <[EMAIL PROTECTED]> writes:

> On Tue, Dec 11, 2007 at 08:24:07AM -0500, Haines Brown wrote:
> > Benjamin Schmidt <[EMAIL PROTECTED]> writes:
> > 
> > > 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/*
> > 
> > Benjamin, thanks for the suggestion, but I had a problem with the
> > script:
> > 
> > Cowardly refusing to create an empty archive
> > 
> > I don't understand this error. 
> 
> It means that when tar followed all the instructions you gave it,
> there was nothing left to put in the archive, so it sanely refuses to
> create the archive. I looks like you're missing the final path on that
> line. man tar

Andrew, I appended a "\*" to the script and it seems now to
run OK. Thanks.

-- 
 
   Haines Brown, KB1GRM

 



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: backup script partly fails when in cron.weekly

2007-12-11 Thread Andrew Sackville-West
On Tue, Dec 11, 2007 at 08:24:07AM -0500, Haines Brown wrote:
> Benjamin Schmidt <[EMAIL PROTECTED]> writes:
> 
> > 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/*
> 
> Benjamin, thanks for the suggestion, but I had a problem with the
> script:
> 
> Cowardly refusing to create an empty archive
> 
> I don't understand this error. 

It means that when tar followed all the instructions you gave it,
there was nothing left to put in the archive, so it sanely refuses to
create the archive. I looks like you're missing the final path on that
line. man tar

A


signature.asc
Description: Digital signature


Re: backup script partly fails when in cron.weekly

2007-12-11 Thread Haines Brown
Benjamin Schmidt <[EMAIL PROTECTED]> writes:

> 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/*

Benjamin, thanks for the suggestion, but I had a problem with the
script:

Cowardly refusing to create an empty archive

I don't understand this error. 

-- 
 
   Haines Brown, KB1GRM

 



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: backup script partly fails when in cron.weekly

2007-12-10 Thread Benjamin Schmidt
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 [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



backup script partly fails when in cron.weekly

2007-12-09 Thread Haines Brown
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

-- 
 
   Haines Brown, KB1GRM

 



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]