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.

#1 2016-03-04 11:46:52

wujo11
Member
Registered: 2008-09-16
Posts: 35

Crontab won't execute script (DNS-323 & ffp 0.5)

Ok, I've done the trick with editcron.sh to put my cronjob in the crontab after reboot. Problem is the script won't execute.

Look:

crontab -l

Code:

30 2 * * * /usr/sbin/stime&
32 2 * * * /usr/sbin/rtc -s
30 2 2 * * /usr/sbin/rtc -c
00 5 * * * /mnt/USB_key/ffp/bin/backupti.sh >/dev/null 2>&1

Last line is my script.

/mnt/USB_key/ffp/bin/backupti.sh

Code:

#!/bin/sh

rsync -e"ssh -i /path.to/id_rsa" -aP MyUsername@HostIP:/path/to/host/backup/ /path/to/local/backup --exclude '*.sql'

If I run backupti.sh from command line it is executed. Cron won't run it.

I thought it may be a rghts issue so I modified crontab like this:

Code:

00 5 * * * su - root -c /mnt/USB_key/ffp/bin/backupti.sh >/dev/null 2>&1

Still no execution from crontab. Time and date on device are correct. Any ideas?

Offline

 

#2 2016-03-05 12:16:47

Mijzelf
Member / Developer
Registered: 2008-07-05
Posts: 678

Re: Crontab won't execute script (DNS-323 & ffp 0.5)

Any ideas?

Environment. I guess rsync is /ffp/bin/rsync. Cron doesn't have the /ffp directories in it's PATH, so you'll have to add an 'export PATH=/ffp/bin:${PATH} to your script

Offline

 

#3 2016-03-07 14:18:41

wujo11
Member
Registered: 2008-09-16
Posts: 35

Re: Crontab won't execute script (DNS-323 & ffp 0.5)

I've tried with PATH's but it wasn't the issue. I figure it out (with some help), that -P parameter inside script causing problems. It looks like you can't put into cron something which verbose to OUTPUT which is >/dev/null, it needs to be file (or -q option for no progress info at all).

Last edited by wujo11 (2016-03-07 14:19:19)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB