Moderator Control Panel ]

Enable crontab

Anything from the case design to the chip inside, from expectation to suggestion, the most important thing is, you are IN.

Enable crontab

Postby qvindesland » Tue Dec 17, 2013 8:07 pm

Hi

I made a script to check that checks my sd card is mounted as i need it for store the temp files so we can rewind and pause but when I do crontab -e I get crontab: chdir(/var/spool/cron/crontabs): No such file or directory suggesting that crontab is installed but not enabled, how would I enable crontab?

Regards
Per
qvindesland
 
Posts: 1
Joined: Wed Jul 24, 2013 2:22 am

Re: Enable crontab

Postby Fant » Wed Sep 24, 2014 3:47 am

I can not make a working crontab.
Prompt how to make the right to work crontab?
What am I doing wrong?

root@DVB226:/# date
Wed Sep 24 03:41:53 CST 2014
root@DVB226:/#
root@DVB226:/# uptime
03:42:01 up 21 days, 1:24, load average: 0.00, 0.00, 0.00
root@DVB226:/#
root@DVB226:/# date
Wed Sep 24 03:42:07 CST 2014
root@DVB226:/#
root@DVB226:/# crontab -l
43 03 * * * root reboot
root@DVB226:/#
root@DVB226:/# date
Wed Sep 24 03:42:30 CST 2014
root@DVB226:/#
root@DVB226:/# uptime
03:42:41 up 21 days, 1:25, load average: 0.00, 0.00, 0.00
root@DVB226:/#
root@DVB226:/# uptime
03:43:05 up 21 days, 1:25, load average: 0.00, 0.00, 0.00
root@DVB226:/# uptime
03:44:03 up 21 days, 1:26, load average: 0.00, 0.00, 0.00
root@DVB226:/#

In 03:43 system not rebooting.
Why ?
Fant
 
Posts: 3
Joined: Tue May 27, 2014 3:07 am

Re: Enable crontab

Postby zhangchao » Wed Sep 24, 2014 11:21 am

hello ,

i'm sorry to give the reply for delay.
if you want to use crontab, you can refer to this :
1. login moi+ via ssh :

# cat /root/cron/root
*/1 * * * * /root/monitoring-script.sh
*/1 * * * * /root/monitoring-script.sh" mean run
"/root/monitoring-script.sh" every minute - if you want to run it
let's say every 3 minutes you change that to:
*/3 * * * * /root/monitoring-script.sh

2.

add startup script for 'cron' - in my case it's called "S70cron":
# ls -l /etc/init.d/S70cron
-rwxr-xr-x 1 root root 1273 Apr 23 06:53

3. startup script


#! /bin/sh
#
# crond Start/Stop the cron clock daemon.
#
# description: cron is a standard UNIX program that runs user-specified \
# programs at periodic scheduled times. vixie cron adds a \
# number of features to the basic UNIX cron, including better \
# security and more powerful configuration options.
# processname: crond


# See how we were called.

prog="crond"

start() {
echo -n $"Starting $prog: "
if [ ! -e /var/spool/cron ]; then
mkdir /var/spool/cron
mkdir /var/spool/cron/crontabs
cp /root/cron/root /var/spool/cron/crontabs/root
fi
killall crond
crond
}

stop() {
echo -n $"Stopping $prog: "
killall crond
}

restart() {
stop
start
}

reload() {
echo -n $"Reloading cron daemon configuration: "
killall crond -HUP
RETVAL=$?
echo
return $RETVAL
}

case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
reload)
reload
;;
status)
rhstatus
;;
*)
echo $"Usage: $0 {start|stop|reload|restart}"
exit 1
esac


Best regards !
zhangchao
 
Posts: 36
Joined: Thu Jan 17, 2013 4:59 pm


Return to General discussion

Who is online

Users browsing this forum: No registered users and 3 guests