Unfortunately no one can be told what fun_plug is - you have to see it for yourself.
You are not logged in.
In a Telnet session I'm using BusyBox v1.12.1 (2008-09-29 20:38:04 CEST). But when I run the same script scheduled through Cron I'm using BusyBox v1.00-pre1 (2008.03.21-07:56+0000) ???
I'm logged in as Root and this is the result when i do a PS:
1567 root crond
1622 root /ffp/sbin/telnetd -l /ffp/bin/sh
1643 root /ffp/bin/sh
This tells me that Cron also operates as root (right?).
All I want to do is a simple copy command: "cp -al source dest"
Through my Telnet session I works but scheduled I have not the same copy options available.
My test script:
#!/bin/sh cp -? >> /mnt/HD_a2/copyerror.log 2>&1
My NAS is a CH3SNAS with firmware 1.03 and FFP 0.5.
How can i get the same copy options when my scripts are running through Cron?
Offline
fonz wrote:
use #!/ffp/bin/sh instead of #!/bin/sh
Thanx Fonz, I tried that, it doesn't work :'-(
My test script:
#!/ffp/bin/sh echo -Setup 1 >> /mnt/HD_b2/Backup_NAS/copyerror.log 2>&1 cp -? >> /mnt/HD_b2/Backup_NAS/copyerror.log 2>&1 echo -Setup 2 >> /mnt/HD_b2/Backup_NAS/copyerror.log 2>&1 /ffp/bin/cp -? >> /mnt/HD_b2/Backup_NAS/copyerror.log 2>&1
and the output
-Setup 1
cp: illegal option -- ?
BusyBox v1.00-pre1 (2008.03.21-07:56+0000) multi-call binary
Usage: cp [OPTION]... SOURCE DEST
-Setup 2
/ffp/bin/cp: invalid option -- ?
BusyBox v1.12.1 (2008-09-29 20:38:04 CEST) multi-call binary
Usage: cp [OPTION]... SOURCE DEST
Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY
Options:
-a Same as -dpR
-d,-P Preserve links
-H,-L Dereference all symlinks (default)
-p Preserve file attributes if possible
-f Force overwrite
-i Prompt before overwrite
-R,-r Recurse directories
-l,-s Create (sym)linksOffline
Hm, yes. You don't have ffp environment variables set when running from the firmware crond. Change your script like this:
#!/ffp/bin/sh export PATH=/ffp/sbin:/ffp/bin:$PATH ...
Offline
fonz wrote:
Hm, yes. You don't have ffp environment variables set when running from the firmware crond. Change your script like this:
Code:
#!/ffp/bin/sh export PATH=/ffp/sbin:/ffp/bin:$PATH ...
Great, this works! Thanx.
Is this by design or did I make a mistake somewhere while setting up FFP?
Offline
by design. i modify the scripts to include /ffp/etc/profile
if [ -z ${SOME ENV VARIABLE FROM FFP ONLY, $MAIL WORKS FOR ME} ]; then
. /ffp/etc/profile
fiLast edited by SilentException (2008-10-11 17:39:08)
Offline