Cron is used to execute scheduled commands. It acts as a task scheduler on Linux and UNIX systems which will execute commands at specified times set by the user. Cron has a great deal of customization and is often used on server environments where common tasks are run on a regular basis.

learn more… | top users | synonyms (2)

1
vote
0answers
14 views

How to persist on a wifi connection after disconnection?

I've got a Ubuntu machine running a software that requires internet. However, sometimes the wifi fails (router reboot for example) and doesn't find the network again, until I manually service ...
184
votes
34answers
279k views

Reasons why crontab does not work

Often, crontab scripts are not executed on schedule or as expected. There are numerous reasons for that: wrong crontab notation permissions problem environment variables This community wiki aims ...
1
vote
0answers
15 views

Screen in crontab

I'm trying to run 9 screens windows by crontab, and then, run some codes (basically the same for all of them), but they don't work. The code runs all of 9 screens, but run code only on the first. Aah, ...
0
votes
2answers
3k views

How to add the logs to a crontab with time stamp

In crontab, I scheduled a daily backup script. Now when the cron executes the script the status are logged to a log file as shown below. 0 0 * * * /home/backup.sh > ...
0
votes
2answers
28 views

Where are cron logs stored on Ubuntu 14.04?

I am trying to troubleshoot why my cron task isn't working sometimes. Where does cron store log files by default? Is it /var/log/syslog ? I have looked at that file and it is empty. Do I need to ...
1
vote
0answers
19 views

First-time backup landed in the wrong place

I used Backups with the following settings: Folders to save: Home(jeg) [ON] Folders to ignore: Trash, ~/Downloads [ON] Storage location: 799 GB Volume [ON] Folder: LinuxBackupDirectory [ON] ...
11
votes
5answers
6k views

Generic solution to prevent a long cron job from running in parallel?

I am looking for a simple and generic solution that would allow you to execute any script or application in crontab and prevent it from running twice. The solution should be independent on the ...
2
votes
2answers
21 views

kcron not running commands

When I add a new command to kcron it seems to work fine. I hit Run Now and it works perfectly. BUT when the task is scheduled it never runs. How do I get kcron to run commands exactly as Konsole can ...
0
votes
1answer
42 views

How to create a perl script which checks the system stats(CPU,RAM,HDD) and sends an alert mail? [closed]

The script is for adding to the cron tab. The flow of the shell script should be like this. 1. Checks the CPU state. 2. Checks the RAM usage. 3. Checks the HDD usage. 4.Sends an alert mail to ...
1
vote
1answer
31 views

Cron script Exec format error

My cron job/script fails. I'm running mythbuntu 14.04. With previous version of Mythbuntu I have a problem, any help would be greatly appreciated! I set up cron.daily with: $ ls -la ...
4
votes
2answers
61 views

Why my bash-script doesn't work with cron?

I created a bash script to automatically update my Ubuntu Server. Here is the script: #!/bin/bash apt-get update apt-get upgrade echo "Update am $(date "+%d. %m. %y|%H:%M:%S) >> ...
0
votes
0answers
27 views

Why does rsync run in crontab not work the same as from the command line?

I have rsync scheduled to run in my root crontab with the archive option: 0 22 * * 6 /usr/bin/rsync -avv --delete --log-file=/home/brian/rsync.log /home /media/wdsentinel/home_backup When I add ...
2
votes
0answers
103 views

How to make speaking clock ( via cron and festival tts) work while playing music

I switched to linux since last 11 months,I am on ubuntu 15.04, I have learned to use cron for various tasks. I use Cron to announce time via festival tts(using mbrolla voice) hourly. This is the ...
8
votes
2answers
11k views

How to run crontab as user:www-data?

My LAMP is setup to work as user:www-data and all files and folders are created with that permissions. I have setup for crontab as user@ubuntu. So i do crontab -e and use this command: */5 * * * * ...
0
votes
4answers
12k views

Cron job to restart Apache

Ubuntu Server 12.04. I use: sudo crontab -e * * * * * root /etc/init.d/apache2 restart > /dev/null 2>&1 sudo restart cron And it doesnt work. How to fix it? So many docs in google,I need ...
0
votes
1answer
18 views

how to run scheduled task ,after resume from sleep,only if computer was sleeping at the time of schedule

i have a cron backup job set up, but i would like it to run after resume from sleep, if my computer was asleep at the scheduled time. example: backup script runs every night at 2:00. often i put my ...
1
vote
1answer
168 views

Crontab not executing script with cURL

I have a cron that's set to run every ten minutes that works fine if I execute the file manually by entering php register.php But, my cron will not execute this file once it includes anything cURL ...
1
vote
2answers
61 views

How to execute a php script using cron?

I am trying to execute a php file via cron every 2 minutes, but it's not working. My crontab is: */2 * * * * usr/bin/php /var/www/test/cron.php What am I doing wrong?
1
vote
2answers
53 views

error while cron scheduling a sh script

This is my shell script which i want to schedule using cron job. parser.sh #!/bin/bash source .profile workon venv cd /home/ashish/deployments/myproject export ...
0
votes
2answers
2k views

How to stop cron from mailing me?

I have setup a ssmtp server with my gmail username and password. After that i have been getting constant emails from my laptop to my gmail. Here the mails. The first one is somewhat like this: The ...
1
vote
1answer
29 views

ifdown in cron bash script fails to run

I have a script that is run when a server (Ubuntu 14.04) boots up using @reboot in crontab (Under the root user) @reboot /bin/bash /root/init.sh >> /var/logs/vminit.log The script runs a ...
2
votes
1answer
38 views

Reset hibernation delay from command line

My hibernation on Ubuntu 14.04 LTS works fine. But someone keeps changing its delay to never hibernate. I am tired of paying days' worth of electricity for 10 minutes usage a day. Is there a way I ...
3
votes
2answers
101 views

Why putting a script in /etc/cron.hourly is not working?

I put an executable script in /etc/cron.hourly, but that script didn't run every hour actually it never runs at all. Here is the script(Hour-sound) that i made: #!/bin/bash mplayer ...
7
votes
5answers
4k views

Notify-send doesn't work from crontab

I made a script that should notify me when there's a new chapter of manga that I'm reading. I used the command notify-send to do this. The program works when I am trying to run it in terminal. The ...
2
votes
1answer
190 views

Configuring logrotate without root access (per user log rotation)

How best can logrotate be configured, on a per-user basis, to rotate files in the home directory of the user, under control of a per-user crontab -e?
1
vote
1answer
28 views

Cron can't find file at night? [duplicate]

I have a cron job written to root (I'm writing to a log in /var/log so need root permission). The problem is that sometimes it works, and sometimes it doesn't. The cron job is simply to call a python ...
0
votes
1answer
31 views

sleep getting hang in shell script

I had a cron script running on my Ubuntu PC ( 12.04.3 ) which periodically checks for disk space. There was a "sleep 5" also used in this script. This system was up for a month, but an issue is ...
3
votes
2answers
2k views

CRON is changing encoding?

I have a legacy Java program that outputs an SQL script. I then use Apache Derby to run that SQL on the target database (which is not on the same server as CRON). When run via putty, this works fine. ...
1
vote
1answer
31 views

log cron job in real time

I have a Python process which I run nightly via a crontab. It scrapes an API which I have limited access to so regularly has to stop and wait for an hour. By my estimates the job should take 5-6 ...
0
votes
3answers
277 views

Run rkhunter regularely on a desktop system

I want to get a warning on my desktop when rkhunter finds something odd on my system. I whitelisted some files and dirs that seem ok in /etc/rkhunter.conf so I get no warnings anymore. Now I want to ...
1
vote
2answers
40 views

What is the correct way to edit a crontab file?

I am trying to automate the refreshing of awstats for my webserver and understand that i need to use cron to set that up. So each user has a crontab file? I was following the instructions here ...
6
votes
5answers
10k views

cron.daily jobs not running

I created 3 daily cron jobs to run. Below are the three that are placed in etc/cron.daily rkhunter.sh #!/bin/sh ( rkhunter --versioncheck rkhunter --update rkhunter --cronjob --report-warnings-only ...
1
vote
3answers
18k views

Use /etc/aliases for outgoing mail relayed by postfix with local domain

I'm using Ubuntu 12.04 with postfix configured as satellite system that relays outgoing mail to Gmail. For sake of example, my registered domain is example.com I want root cronjobs' error output to be ...
1
vote
2answers
2k views

Auto shutdown server if there was no activity

My server should shutdown after 01:00 am, if there was no activity in the past hour. Lets say there was the last connection at 00:43 then it should check again at 01:43. How to write such a ...
2
votes
0answers
36 views

No crontab for user, yet cron jobs are running

I have no apparent crontab: $ contab -l no crontab for gauthier Yet, something seems to be running as my user: $ tail /var/log/syslog ... Apr 13 16:25:01 sobel CRON[22043]: (gauthier) CMD (rsync ...
2
votes
1answer
15 views

Time based access to samba server

I have a 14.04 server running samba. I'd like to institute some time based access to the server. I host media for the whole house, and the goal is for the kids' televisions to become useless at a ...
2
votes
3answers
2k views

Function of /etc/cron.hourly

If I create a script and then place it in this folder (/etc/cron.hourly), will my system run this script hourly? Or does my script need to begin with a command as well?
-1
votes
1answer
18 views

different behavior of script when it runs on crontab

I'm trying to write a script that checks if mysql is running, and if not restart it... i get a script to run perfectly if is called manually from terminal, but when i added to crontab it outputs is ...
3
votes
3answers
4k views

Is there a way to suspend/sleep via bash?

I have to get nine 46" LCD monitors (running Windows) to suspend/sleep at 8pm and wake at 8am every morning. It's been a bit of a mess trying to get the commands working, including the privileges. ...
4
votes
1answer
69 views

Permanently raising nofile limits in Ubuntu 14.04 LTS

I cannot seem to figure out what exactly is needed to allow the maximum number of file descriptors to be raised permanently for all users. /etc/security/limits.conf: root hard nofile ...
3
votes
1answer
55 views

Create zip files in /var/www/html using crontabs

As the title explains, I'd need to take a file and put it into a zip archive once a day; also, the zip file has to be moved in /var/www/html, where a .php scripts allow users to download it. Assuming ...
1
vote
1answer
91 views

reprepro - Is there any chance to enter the passphrase via bash-script?

I use "reprepro" for getting the latest Debian packages out of my local repository, which works fine manually. Now I need to automate this process through a cron job but the reprepro passphrase is a ...
0
votes
0answers
29 views

An Nmap Script and Crontab

I have created a script that will run an Nmap scan, then go through the results and see what is different from past results. Then email the differences. I have been trying to get it to run ...
1
vote
1answer
49 views

Command works on terminal but doesn't work in cron [duplicate]

I have the following command that I can run from any folder and it will start my (Angularjs) webapp by using the grunt task runner tool - cd /root/dev/myapp && grunt serve However when I ...
0
votes
1answer
25 views

Where do I look for cron errors [duplicate]

I have 2 cron jobs that were running fine but now stopped running. I looked through my crontab and everything looks OK. How can I tell if these jobs are running? is there a place where cron stores ...
218
votes
4answers
415k views

Where is the cron / crontab log?

I want to verify if my cron job is executing and what time. I believe there is a log for my sudo crontab -e jobs, but where? I searched google and it I found references to look in /var/log ...
0
votes
0answers
41 views

Ubuntu shuts down unexpectedly, Every night

I know this sounds weird but unfortunately it's real. I have Ubuntu 14.04 LTS running on Dell Inspiron N5150 Laptop with intel i7 CPU and nvidia GeForce GPU. Every night between 9:30 pm and 11 pm ...
1
vote
2answers
64 views

.sh ffmpeg works manually, not with CRON

I make a movie from jpeg pictures with the script: #create movie ffmpeg -i /home/philippe/Dropbox/Public/Cheiron/day/%d.jpg -r 25 -q:a 5 -pix_fmt yuv420p ...
1
vote
1answer
65 views

Cron jobs with R scripts

I am trying to schedule cron job for an R script. I've read this question How do I set cron job and followed suggestions from first answer. I typed crontab -e In the command line and put there a ...
2
votes
1answer
69 views

What is messing up my system clock?

Ubuntu 14.04 desktop, 64-bit I came in to work this morning and noticed that the clock on my system was off by approximately 3 minutes, as compared to the clock on my phone. That seems odd, since my ...