cron is a task scheduler based on clock time that runs on Linux-based machines.

learn more… | top users | synonyms

0
votes
2answers
16 views

Restarting process in CentOS if server restarts

I have a VPS with some Java applications (made with "Play Framework") running on ports 9000, 9001, 9002 and 9003. VPS Provider (iPage) happens to reboot servers unexpectedly from time to time, leaving ...
0
votes
1answer
31 views

Cronjob etiquette?

I am a student at a relatively small university. I wrote a script that sends me an email when a math newsletter comes out, so I can get a head-start on the problem of the week. I plan to run it as a ...
0
votes
2answers
22 views

Write PID To File On Bash Execution

I'm executing a bash script via cron. I want to write the process id (PID) of the script to a /tmp/ file for reference, in case I need to kill it later on (this script can take 6 - 10 hours to ...
0
votes
1answer
28 views

Strange timing behaviour

I need to run a CRON each 5 minutes for a specific user example.com, the script executed is a php file. File : /var/spool/cron/crontabs/example.com /5 * * * * /usr/bin/php -f ...
-1
votes
1answer
45 views

Double pipe “||” not working in cron jobs

fellow SUers, I am trying to run a watchdog cron job to make sure a process is running (DreamHost keeps killing processes). I was inspired by this SU question. However, the double pipe || seems not ...
0
votes
1answer
24 views

Can't create incron job

I am trying to create incron job, but no success. When I type: incrontab -l I got: no table for vujke and when I type: incrontab -e I got: editor finished with error: No such file or ...
0
votes
1answer
16 views

Cron jobs on IBM i 7.1

I just found out today that on an IBM i system I am able to use SSH to get to a Unix-like terminal (AIX/PASE) and would like to use this to schedule automated tasks using crontab. Does anyone know if ...
0
votes
1answer
35 views

How to get crontab to run when backup requires a password

I am running a script to backup my postgres database on Debian. I am basically running exactly this: https://wiki.postgresql.org/wiki/Automated_Backup_on_Linux Now I have everything working fine when ...
0
votes
0answers
26 views

Maintain screen session when executing shell script on boot

On Ubuntu 14.04, I have a crontab entry set to run on reboot: @reboot /root/start_server.sh And here's start_server.sh: screen -dmS server bash -c "cd server ; ./run.sh" When the system starts ...
0
votes
2answers
23 views

Synchronized script execution across multiple servers

I'm looking to run an automated task (a shell script) on multiple Ubuntu servers at the same time with as much timing accuracy as possible. Ideally, I'd like the time discrepancy between the start of ...
1
vote
1answer
32 views

cron jobs set for different times, but execute at the same time

I have a file which I loaded into crontab with the following jobs, and crontab -l reports the following: # runs daily at 2:00 am and 2:05 am 30 12 * * * /usr/bin/wget -q -O temp.txt ...
0
votes
0answers
28 views

Daily crontab with hg, git and svn

Hello I have made a script that updates some repos from git merc and svn, then updates a git repo. The script works manually but doesn't work in crontab, here is the script: #!/bin/bash cd ...
0
votes
2answers
31 views

Why is this cronjob not working?

I have a ruby script in ~/custom_scripts/get_all_products.rb. I want it to run every night at 04:00. Here's what the cronjob in crontab -e looks like: MAILTO="<email>" 0 4 * * * ruby ...
0
votes
1answer
30 views

“echo” prints the options in crontab

I'm running Rasbian 3.12.26+ on a Pi model B. Here is what my cron entry looks like: * * * * * sleep 11; { echo -en "\e[1;4;33m"; date; echo -en "\e[0m"; curl -k "http://sampleurl.com/update.php"; ...
0
votes
1answer
12 views

How to execute a Linux Cron Job from day x to y on crontab?

I found that I can use an hour range by using a slash, for instance, 4-20 to run from 4AM until 8PM. But what about day range? Can I use something like: * * 5-20 * * CMD
0
votes
2answers
43 views

Is there any reason this cronjob would fail in cron, but not on the command line?

I have written a little one liner that will email me when a list of files changes - I used sha512 to generate a list of hashes and then periodically check that those hashes still match. */5 * * ...
1
vote
2answers
40 views

How to find out the reason why a scheduled task hang?

I have scheduled quite a number of tasks in my Windows 7, doing a variety of cron jobs on my machines. I am perfectly sure that these tasks, when run on their own, won't hang. But the problem is ...
0
votes
0answers
31 views

How to run browser in background in Ubuntu

I am using Ubuntu 14.04, and PHP. I have 2 files: test.html - content java to test network update.php - the test file will post result to update database. I need to run and execute an URL address ...
0
votes
1answer
19 views

btrfs won't run from cron

I'm trying to set up a cron job to create a btrfs subvolume snapshot of my root partition. The command works perfectly if I run it from the command line, but nothing happens at the scheduled cron ...
0
votes
1answer
226 views

DD-WRT Additional Cron Jobs aren't running

I have installed DD-WRT (v24-sp2 (06/23/14) std - build 24461) on a TP-Link TL-WR841ND v9 and I'm trying to add a CRON job to update my Unlocator IP configuration as described here: How to set up a ...
0
votes
2answers
72 views

crontab is not working

I am using Linux Fedora. I want to create a crontab with SCP command, but it's not working. [shiv@db2 ~]$ crontab -l #this is server to server copy... */2 * * * * date >> ~/$ scp ...
0
votes
0answers
15 views

crond regularly maxes out CPU

I'm running Arch Linux ARM and I've having a few issues with crond. I have a conky that displays the top 5 processes (in terms of CPU usage) and every few minutes, crond will appear at the top of the ...
4
votes
4answers
408 views

How to use “date” to print tomorrow's day of the week

On CentOS 6 Linux I use date +%a in several cronjobs and scripts to generate logfile names like myprog-Tue.txt and this works well for me since many years. But now for one program I need to delete ...
3
votes
4answers
62 views

Is there a way to tell cron to trigger a particular cron job right now?

The cron job for updatedb didn't run because the system was powered off at the time. I'd like to tell cron to run that job now, as if now were the schedule time. Is there a way to do that? For this ...
0
votes
0answers
13 views

cron unavailable, how should I run old jobs?

My hosting company requires cron jobs to be entered one-at-a-time thought thier web interface rather than the command line. I've got about 70 jobs to transfer over from another host. Is it ...
1
vote
2answers
78 views

cron table mailx caused empty content

I'm using centos 7.0/6.5. The content of /etc/cron.hourly/mail.cron #!/bin/sh log=/var/log/mail.cron.log echo "`hostname` `date`" >> $log 2>&1 mailx -s "test mail" me@example.com < ...
0
votes
0answers
29 views

Disappearing Crontab, Odd Files

I have a number of Debian-based systems running on an ARM-based SBC connected to a network and they've been running for years. All of a sudden, when I log onto several devices, the cron file is ...
0
votes
0answers
13 views

How can I queue a script to run the next time a system is up and connected to the internet?

I'm using mailsend (on a Mac) to send mail from the command line. I'd like to set this up such that I can execute a send command, but if my system is disconnected from the internet, that command is ...
2
votes
0answers
20 views

Performance loss when having too many files in /etc/cron.d?

Is there an amount of files in /etc/cron.d that would lead to worse performance? There are currently about 50 jobs in. In the future there can be up to 200 files in. Am I correct to expect the cron ...
0
votes
0answers
55 views

Is it better to use the systemd service unit's Restart & RestartSec, or use a systemd timer unit?

I have a couple of in-house automated scripts running at periodic intervals. One is every five minutes, the other is every minute. They don't really need to be ran on-the-dot; e.g. I don't care if ...
0
votes
1answer
56 views

mysql backup verification

Im not a dabase admin or advanced database user or advanced linux user.. but I would like to know how to verify mysql dumps because I am backing up my own sites manually. Normally when backing up lot ...
0
votes
1answer
129 views

Ubuntu Cron ec2-create-snapshot

I have a new ec2 Ubuntu instance running. I have properly set up the ec2-api tools. I want to create a daily backup using the ec2-create-snapshot command. Just to test it, I have my script, which is ...
1
vote
0answers
34 views

How can I run a cron job from PM to AM? [duplicate]

I want to execute a script once an hour from 20:00 to 08:00. Would the following work? 0 20-8 * * * location_of_script_to_run I'm currently using the following: 0 20,21,22,23,0,1,2,3,4,5,6,7,8 * * ...
0
votes
0answers
50 views

How to run an script using cron in Windows 7 using cygwin?

I have installed all the dependencies in cron. My scripts are working properly, and also I have tested cron which I think works properly as well. However, I would like to set up a task to run a script ...
0
votes
0answers
28 views

How to parallelize crontab executions to increase user base for web app based on mongodb and mysql?

I have a symfony based web application that runs on mongodb and mysql backend. The principle of the application is that for each user there is a python script that runs 4-12 times a day on cronjobs ...
0
votes
0answers
117 views

cron job monitoring script

greeting of the day!!! please help me a situation, i am trying to develop a script which provides me details which my cron job is commented or stopped which job is running or scheduled. like we ...
0
votes
0answers
9 views

Trying to find dbus session, doesent work

Trying to use notify-send with cron, it needs dbus, what im i doing wrong? var= $(set | grep '^DBUS_SESSION_BUS_ADDRESS=') export DBUS_SESSION_BUS_ADDRESS=$var #!/bin/sh { ...
0
votes
0answers
49 views

Make a script identify DBUS session address and use it

I'm using cron with notify-send to display some notifications, but it requires DBUS session to run Here is the script: export DBUS_SESSION_BUS_ADDRESS=[session] #!/bin/sh { DISPLAY=:0 ...
0
votes
2answers
73 views

How can I get a script to run constantly on Mac OS X?

I would like to do this: When the application VLC is open and I press the space bar, it pauses the video and an itunes starts to play. Then spacebar again would resume the workout video and pause my ...
0
votes
1answer
25 views

Set cron's maximum run counter

How do I setup cron to run only for a specific number of times? Let's say I want to setup cron so that it runs hourly, but when the scheduler has already run five times, I want to stop cron. How do I ...
0
votes
1answer
97 views

WGET/cron downloading webcamera file

our new town doctor put a web camera to his waiting room for people to see how much crowded it is. As my mom and grandparents go to this doctor, I wanted to download the files periodically and if they ...
1
vote
1answer
239 views

Permission Denied in Crontab

I've searched half a day for the answer to this, with no luck. Any assistance will be appreciated. I have a PHP script that modifies the crontab, loads a new cron job, removes some etc. The script ...
0
votes
1answer
147 views

Cron error “missing url”

Hope this is the correct place to post this. I am setting up a cron job to refresh a twitter feed. I want to overwrite the file each time the cron job executes. My current command is: /usr/bin/wget ...
0
votes
1answer
215 views

Simple script run via cronjob doesn't work but works from shell

I am on shared hosting and I'm trying to schedule cronjob to run every now and then. Via cPanel I scheduled to execute my script but even though that according to my host support the cronjob runs, the ...
-1
votes
2answers
37 views

What is the risk when editing crontab file without the “crontab -e” command?

I developed a script in which I add lines to the crontab file with echo command and I remove lines with sed command. I do not know the risk of that especially that I find in some web site that we ...
0
votes
0answers
40 views

Warning: the connection is closed, while running cron job

I have found on the Internet simple script to download wallpaper from bing and set it. #!/bin/bash # export DBUS_SESSION_BUS_ADDRESS environment variable useful when the script is set as a cron job ...
0
votes
1answer
43 views

Run cron task at specified day of week but at any time

I ran into trouble with cron. I need to run task on my desktop but the thing is I can't guarantee that my computer will be turned on in specified time. For example I need to execute task weakly If ...
1
vote
1answer
59 views

Script not running as cronjob

I got a script which runs in a cronjob as root. The problem is that the addgroup command would output "Command not found" when it gets executed by the script. #!/usr/bin/perl $datei = `ls ...
0
votes
1answer
55 views

Check shell Script copy Status

I have a cron script and i need to adjust it; Actually some clients are generating in a directory some files, my task is to backup that files to a tape, and i need to make a if then else cp $files ...
2
votes
1answer
104 views

Have cron parse SSH config file for server addresses and options

How does one configure cron to parse ~/.ssh/config to get the IP addresses and other options (such as IdentityFile) for SSH? Obviously adding source /home/user/.ssh/config does not help. I do not ...