DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2010-03-05 20:08:55

stutuff
Member
Registered: 2010-02-25
Posts: 8

rsync crashes (after a while) when running from cron

I am running a backup script using full PATH extensions. Here is the rsync part:

BINDIR="/mnt/HD_a2/ffp/bin"

for source in $SOURCES; do

  $BINDIR/rsync -av --delete --log-file=$LOGFILE $STARTDIR/$source $TARGET/backup.0

done

after 2 1/2 hours of backup (this is the first backup on a fresh drive) I get:

2010/03/05 05:44:44 [29218] rsync error: errors with program diagnostics (code 13) at log.c(237) [sender=3.0.4]

The 'for loop' then looks at a new folder and that runs for a few seconds (backing up a few dozen small files) and then crashes again with the same error message. This has happened two nights in a row.

When I run the backup manually everything is fine. Any ideas about what the problem is would be very helpful.

DNS-323 firmware 1.07
rsync pagkage is 3.0.5-1

Offline

 

#2 2010-03-05 23:22:07

karlrado
Member
Registered: 2009-12-07
Posts: 229

Re: rsync crashes (after a while) when running from cron

How many files are in each of the $SOURCES folders?  I've had some trouble with very large numbers of files, which I attribute to running out of memory, but I'm not certain yet.

Do your lights on the unit start flashing orange?

I also have an intermittent problem with getting the 13 rc from rsync, often accompanied by the flashing lights.  Subsequent disk diagnostics after a reboot turn out ok.


DNS-323 FW 1.07 : 2 1TB WD Caviar Green SATA : fun_plug: utelnet + optware (no ffp)

Offline

 

#3 2010-03-06 14:28:43

stutuff
Member
Registered: 2010-02-25
Posts: 8

Re: rsync crashes (after a while) when running from cron

There were thousands of files ranging from small to 10's of MB.

I don't know too much about lights because the units are remote (in the attic). I went up to check it after one failure and the main button was a steady orange.

One thing I note was that after rsync bugged out I could no longer access the files from any computer on the network and the USB device was left mounted (My script umounts the drive when finished with the backup).

I had to restart the DNS to regain remote access.

Offline

 

#4 2010-03-06 17:31:09

switch10
Member
Registered: 2010-02-25
Posts: 27

Re: rsync crashes (after a while) when running from cron

I had a similar problem using the --progress option.  The cron job has no terminal to launch, so it crashes.  try removing the -v.  Also, try removing individual options from -a, and see if that helps...

Offline

 

#5 2010-03-08 00:33:11

stutuff
Member
Registered: 2010-02-25
Posts: 8

Re: rsync crashes (after a while) when running from cron

thanks

I will see what happens next backup...

Offline

 

#6 2010-03-08 20:01:15

karlrado
Member
Registered: 2009-12-07
Posts: 229

Re: rsync crashes (after a while) when running from cron

Sounds familiar.

There is quite a lot of discussion about "orange" or "pink" lights coming on the DNS-323 in the various fora.  I have not yet found a clear set of conditions that cause it nor any good explanations or solutions.  I've seen people report it with no software mods to the 323, and with all sorts of configurations and combinations of drives, etc.  In other words, no discernible patterns...

Anyway, I see this problem occasionally.  In my case, it happens more frequently when there is a lot of file transfer activity.   For example, I went two weeks without seeing it, and then I left a bittorrent running for a week and I've had the orange lights 4-5 times since. 

Sometimes the samba daemons have crashed, which would explain the problem with accessing files from the network.  And sometimes my rsync tasks fail with 13 like yours.

One hypothesis floating around about this is running out of memory.  If you rsync a large NUMBER of files (not large FILES), rsync may need a significant amount of RAM to come up with the "update list".

Another theory is the root filesystem is filling up with junk/log files.

I'm trying to learn more about this one myself.  I'd like to figure it out and fix it.

My only specific suggestion is to make sure that your log file does not go into the root filesystem, as you may be filling that up.  Make sure it goes someplace in /mnt/HD_a2 or whatever.


DNS-323 FW 1.07 : 2 1TB WD Caviar Green SATA : fun_plug: utelnet + optware (no ffp)

Offline

 

#7 2010-03-10 19:32:53

karlrado
Member
Registered: 2009-12-07
Posts: 229

Re: rsync crashes (after a while) when running from cron

Just to follow up with some progress I made...

My orange lights came on overnight again and my root file system was 100% full.  I quickly listed all files in the root file system with "find / -xdev ..." and found some large files sitting in root's home dir.  Turns out that I have a script I run each night that downloads files from my TiVo.  When testing it, I ran it from someplace in /mnt/HD_a2 and some of the files it downloads get stored in the directory where I run the script.  So that's fine in that case.  For cron, the current directory is root's home, in the root file system, and so the root file system is quickly filled up.  I've fixed the script to put all files in /mnt/HD_a2 and I'll see how things go.

If you see the orange lights come on, it might be good to check the root file system to see if it filled up somehow.


DNS-323 FW 1.07 : 2 1TB WD Caviar Green SATA : fun_plug: utelnet + optware (no ffp)

Offline

 

#8 2010-03-22 05:45:20

stutuff
Member
Registered: 2010-02-25
Posts: 8

Re: rsync crashes (after a while) when running from cron

UPDATE...funny stuff going on now

I removed the -v from rsync and that did not do anything.

BUT now commands seem to be running twice. And again...only happens w/ cron
The first few lines of code:

NOW=$(date +"%b-%d-%y")
LOGFILE="/mnt/HD_a2/scripts/backuplog-$NOW.log"

###### Functions ##############
check_errs()
{
  # Check Error Function
  # Param 1 is the return code
  # Param 2 is text to display on failure
  if [ "${1}" -ne "0" ]; then
    echo "ERROR # ${1} : ${2}" >> $LOGFILE
    # exit with the error code.
    exit ${1}
  fi
}
###############

date >> $LOGFILE

$SBINDIR/blkid -t LABEL=DLINKBKUP01 >> $LOGFILE
check_errs $? "Backup drive not found!"

DEVNODE=$($SBINDIR/blkid -t LABEL=DLINKBKUP01 | $BINDIR/awk -F: '{print $1}')

$BINDIR/mount -t ext3 $DEVNODE $DEVMOUNT
check_errs $? "Device mount failed!"

Resulting log file:
Fri Mar 19 03:12:11 GMT 2010
Fri Mar 19 03:12:11 GMT 2010
/dev/sdc1: LABEL="DLINKBKUP00" UUID="752d201c-7e3d-45dd-a52f-023965a1b1c2" SEC_TYPE="ext2" TYPE="ext3"
/dev/sdc1: LABEL="DLINKBKUP00" UUID="752d201c-7e3d-45dd-a52f-023965a1b1c2" SEC_TYPE="ext2" TYPE="ext3"
ERROR # 255 : Device mount failed!
2010/03/19 04:12:30 [24155] building file list
2010/03/19 04:13:21 [24155] sent 1290099 bytes  received 4296 bytes  total size 87043058491
...runs fine for a while from here

notice the duplicate DATE and blkid command results but also the mount error that is false and the checker that did not exit

To top all of this off I have a second DNS-323 running the same script but with no problems (rsync crash  or double logging).
The only difference is that one has firmware 1.04 (no problem) and 1.07 (problem unit)

It almost seems like the cron is trying to run the script twice at the same time but the crontab only has one listing:
12 3 * * 2-6 /mnt/HD_a2/scripts/backup_dlink00.sh

Offline

 

#9 2010-04-06 15:55:29

stutuff
Member
Registered: 2010-02-25
Posts: 8

Re: rsync crashes (after a while) when running from cron

Just to give an update:

The problem went away when I upgraded to DNS-323 firmware version 1.08

I still am using version 1.04 on my second DNS with no problems.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB