When I execute cron
I get this fault
cron: can't open or create /var/run/crond.pid: Permission denied
So, how to do it without cron
?
P.S. I want to check if file in svn has changed and I have a special script for it.
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Sign up to join this communityTo access your personal cron
configuration you should use the command crontab -e
(to edit your cron table).
Alternative is the watch
command:
watch -n10 command args
Finally, to monitor filesystem events more effectively, you could use inotifywait
, from inotify-tools
package.
watch -n<timeout> "command(s) arg(s)"
like watch -n2 "ps ux | grep ss5"
watch
to accept long, complicated commands using pipes and quotes. The while loop below worked, but of course one should always sleep first to avoid runaway pids.
watch -n10 "ls -l | grep $foo"
You can write a shell script that has sleep
in a while loop.
#!/bin/sh
while [ true ]
do
sh special_svn_script.sh
sleep 10
done
while true
does not require square brakets, otherwise "true" is interpreted as a string, and every string is as good as "true".
gnome-schedule (click the button to Install now! using your Software Center)
is a graphical user interface that leverages the power of vixie-cron, dcron and at to manage your crontab file and provide an easy way to schedule tasks on your computer. It supports recurrent (periodical) tasks and tasks that happen only once in the future. It is written in Python using pygtk.
Awesome features
sudo
.crontab -e
to start the editor. To list the current crons, runcrontab -l