You are not logged in.
This line works in the default cron daemon installed in archlinux:
@reboot screen -dmS rtorrent rtorrent
The above line doesn't work in fcron. It gives me this error when I'm done editing the crontab with `fcrontab -e'
File contains some errors. Ignore [i] or Correct [c] ? Please press c to correct, or i to ignore: c
/tmp/fcr-aGQGMP:2: Error while reading frequency (lower than 10s) : skipping line.
This question is even in the FAQ of fcron:
"How can I emulate a Vixie cron @reboot entry?"
@volatile,first(1) BIG-period /your/command
Which should equal:
@volatile,first(1) BIG-period screen -dmS rtorrent rtorrent
This still gives me the same error:
Error while reading frequency (lower than 10s) : skipping line.
I'm not sure what BIG-period is suppose to do. Is it a time period I should write there instead? @reboot isn't a periodic event in cron, so I guess I would omit the BIG-period part.
That didn't work. I also tried changing "BIG-period" to "never", which also didn't work. I'm out of ideas, I don't know what I'm doing wrong.
Last edited by Isola (2011-02-14 15:26:37)
Offline
Offline
Just out of curiosity, did you write "BIG-period" and "never" verbatim or did you enter a big period of time.
I tried writing a time period, like 1 and 1h and 5w1d1h etc. It worked, but it would execute at boot AND after the BIG-period. I want it to be exactly like @reboot. Is there no better way?
Offline
Based on what the FAQ says, probably not. I think 100 years (1200m) should be long enough.
Edit - Why don't you just use /etc/rc.local?
Last edited by Stebalien (2011-02-14 04:55:53)
Offline
Based on what the FAQ says, probably not. I think 100 years (1200m) should be long enough.
Edit - Why don't you just use /etc/rc.local?
I know of rc.local. I use it for system specific things - not user specific "sudo something" or "su someone -c something"
For example one system has this network card by Marvel/Yukon, and sometimes it is brought up at 100mbit instead of 1Gbit, so I have a loop in /etc/rc.local to make sure it is 1Gbit.
Another example is mount --bind /some/long/dir/ /shortcut - if this dir isn't available when /etc/fstab is parsed.
Currently my crontab consist of 4 entries with @reboot - and I change it pretty often - and it has to be on several systems. Appending to rc.local is one option, but it's to much of hassle when I have to change ~10 different rc.locals on different systems.
Anyway, a frequency of 100 years should be more than enough! I guess something like:
@bootrun(1) 100y pidof rtorrent || screen -dmS rtorrent rtorrent
Would work pretty well for a single user system.
Offline
For the network card, you should take a look at writing udev rules.
For the autostart, you could try something like this in your rc.local.
for user in /etc/startup.d/*; do
user=$(basename file)
if [ $(stat -c %u $file) -eq $(id -u $user) ]; then
su -c "$file" - $user
else
echo "Wrong permissions on $file" >&2
fi
done
Offline
Hmm... something like that would work too - but a crontab is simpler. I try to keep as much as possible within the permissions of a user, so I don't have to go root (if I have access to it in the first place).
Offline