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)

0
votes
1answer
53 views

Cron job to set screen brightness not working in ubuntu 14.04

In the terminal, I ran: crontab -e Then I added the following cronjob in the file 26 21 * * * /usr/bin/xbacklight -set 80 This was supposed to set the brightness to 80% at 9:26 PM. But its not ...
274
votes
40answers
433k 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 ...
0
votes
2answers
1k views

How can I get mysqldump to use the credentials from mysql_config_editor in a crontab-executed script?

I am setting up a daily backup of a MySQL 5.6.14 database using mysqldump on an Ubuntu 12.04 Precise server. I created the credentials file in the root home directory (.mylogin.cnf) according to the ...
4
votes
1answer
21 views

ps inside crontab is not seeing a running process

I have this robot worker.py, which I just run as: python worker.py --details There are many problems surrounding this robot, so it keeps going down each 30 minutes. When the robot is running, ps ...
1
vote
0answers
26 views

At job doesn't stop?

I'm trying to schedule a job on Ubuntu using at command: /opt$ at now + 1 min warning: commands will be executed using /bin/sh at> echo "test" > /opt/t.txt at> <EOT> However, the ...
2
votes
2answers
43 views

Auto delete files older than 7 days

I am a complete noob at linux but I am starting to get the hang of it. I have an Ubuntu Server 16.04 running an FTP server to backup security video files. The files will be stored in folders like: /...
275
votes
5answers
423k views

How do I set up a Cron job?

I want to schedule a task to run on a regular basis and have heard that Cron is the way to do this. How do I add Cron jobs in Ubuntu?
0
votes
0answers
25 views

Crontab not working with AWstats

A few weeks ago AWstats ceased updating the static web pages. I hadn't touched anything at all. I am a newcomer to shell but have got to the point where I can find my way around with a few basic ...
0
votes
0answers
18 views

Problem with non-root users crontab and CLI PHP

I'm stuck with the following problem and cannot seem to resolve it and would like some help if possible... I have created a user (lets call it user) and have edited the crontab for that user and have ...
347
votes
5answers
670k 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
2answers
41 views

Autostart a script (.sh) at boot [closed]

Not Ubuntu but Raspbian sorry for that, but I didn't know where else to put it. I have a problem running a script (fullscreen.sh -that is the name of the script). I have tried to put this line: @...
1
vote
0answers
13 views

Can't connect to server through SSH after rtcwake reboot

I used crontab to create an rtcwake command to shut my computer down at midnight, and start it up at noon. The problem is, once it turns off, and then on again, I can't connect to the server through ...
5
votes
5answers
28k views

How to remove or delete single cron job using linux command?

I have created cron jobs for my site which is listed below and they are working fine. I print all cron job by using this PHP script: $cronfiles=exec('crontab -l',$output); echo "<pre>"; print_r(...
1
vote
2answers
53 views

Cron Job doesn't execute

I created a cron job as root with the command: crontab -e Then I added 0 4 24-31 * 4 /home/backupscript.sh after the last line. The output of crontab -e looks like this: # Edit this file to ...
0
votes
0answers
18 views

Crontab script error

I edited a crontab with the command sudo crontab -e and I inserted the line */1 * * * * /home/user/Desktop/bt.sh >> /home/user/logroot.txt 2>&1 The script contains: #!/bin/bash pkexec ...
1
vote
0answers
33 views

Send file through bluetooth crontab

I want to send a file named read.txt using command: bluetooth-sendto. It works using the direct command on terminal bluetooth-sendto --device=MACADDR path/to/read.txt. I want to execute it with this ...
1
vote
1answer
49 views

SSD as /tmp partition

I have a Ubuntu 14.04 server which has one drive where rootfs is mounted. I just added an SSD disk which I have mounted at /ssd Now I want my /tmp & /var/tmp to use this fast drive to speed up ...
1
vote
2answers
82 views

Hibernating from cron

I am trying to hibernate from cron using the command systemctl hibernate. However, I am getting the following error: Failed to set wall message, ignoring: Interactive authentication required. ...
4
votes
3answers
485 views

Cron jobs are disabled on clean installation of 14.04

I have a clean installation of Ubuntu 14.04 and in my /etc/cron.daily/ I see *.disabled files: -rwxr-xr-x 1 root root 15481 Apr 10 09:04 apt.disabled -rwxr-xr-x 1 root root 314 Feb 17 2014 ...
1
vote
1answer
32 views

How do I run a Supervisor task from cron.hourly?

I have a task defined in Supervisor that I would like to invoke hourly from /etc/cron.hourly. I can run it manually, but not from run-parts: $ sudo supervisorctl start my-task -- works # . /etc/cron....
5
votes
3answers
4k 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?
0
votes
2answers
2k views

Running CRON job on Ubuntu server for SugarCRM

I am pretty inexperienced in Linux, so be descriptive on your answer. My environment: Local Linux server 12.04 hosting Sugar CRM 6.5.2. There is area in sugar CRM called scheduler. I can configured ...
0
votes
0answers
99 views

I can't install gnome schedule on Ubuntu 16.04

I would like to install gnome-schedule in my recent Ubuntu 16.04 but I can't find the how. It is not in ubuntu software and if I type "sudo apt-get install gnome-schedule" I get it's not found. I ...
2
votes
1answer
25 views

How to Create a cron job to backup ghost blog directory

I installed dropbox_uploader and set it up. I've successfully created a backup from the command line, now I'd like to make it a script and make it run at midnight daily. Can someone help me create a ...
0
votes
0answers
21 views

Error while running Rscript using crontab

I am running an Rscript using crontab. In that Rscript command, I am trying to load googlesheets package using library(googlesheets). Note, I have already installed googlesheets package. I am getting ...
0
votes
0answers
32 views

Comand to zip a folder with incremental file names?

I have this line in a cron command line: zip -r public_html-1.zip public_html -x *cache/smarty* It works fine but if the file exist it get overwritten. I need to change this command to create files ...
0
votes
2answers
40 views

Can't make cron open a Java program with a GUI

I made a simple "journal" program that will open a GUI, prompt for an entry and a few factors, and print this information to a file under the current date. I've written a short bit of java code that ...
7
votes
3answers
17k views

Shell script issue: cron job script to Restart MySQL server when it stops accidentally

I have this script, I am using it to setup CRON job to execute this script, so it can check if MySQL service is running; if not then it restart the MySQL service: #!/bin/bash service mysql status| ...
0
votes
1answer
64 views

How to open an url in Firefox via cron (cron jobs scheduling) [duplicate]

Am trying to create a cron job to open a web page at a scheduled time. I have edited my cron using crontab -e and append my job. I wrote my job in a script like this: xdg-open (URL) I saved this ...
0
votes
2answers
1k views

rtcwake cron does not work

I intend to put my computer to sleep every night and make it wake up again next morning. I found that rtcwake would serve my purpose. However putting it in the crontab does nothing. Following is my ...
1
vote
1answer
49 views

Get a list of all scripts and their paths which are run as cron job

I am looking for some scripts or a terminal command to list all the active scripts (preferably with their paths), which run on a periodic basis by cron, cron.daily and/or anacron. I am not looking for ...
1
vote
0answers
36 views

Running a py script as www-data from a cronjob fails, but running as a command through terminal works

So, I have this script that needs to run every minute, so I set up a cronjob to run the script, lets say the command is: /var/www/script.py I use Webmin to setup the cronjob and set it to execute ...
0
votes
1answer
22 views

syslog shows 2 users and shows usb device when I didn't use one

So a lot of the syslog code history was deleted just before I was typing this up but here is some of it: SpiRegistry daemon is running with well-known name - org.ally.atspi.Registry Created slice ...
0
votes
0answers
51 views

Crontab - export DISPLAY=:0.0 or .sh script won't run

I have written a basic script to familiarize myself with crontab that changes my wallpaper every minute with one random image from a set folder: #! /bin/bash PATH=/usr/local/sbin:/usr/local/bin:/...
0
votes
1answer
30 views

Python script in CRON is not running in AWS ubuntu 14.04 instance

I want to schedule a CRON job into AWS Ubuntu instance. I have a simple cron sample like the following - import pandas as greatPanda import pprint import uuid df = greatPanda.read_csv('/home/soumik/...
0
votes
1answer
34 views

SSH connection in cronjob denied :“No supported authentication method”

I wanted to set up crontab to fetch resources from remote server to local server. Steps used as below In local server ssh-keygen with no passphrase copied the pubic key over to the server using ...
2
votes
0answers
25 views

Scheduling Cron Job for a Specific Hour Range in a Week

I'm looking to run a cron job for specific hours in a week. The reason I'm doing this is due to the timezone being pegged exactly 7 hours ahead of New York time irrespective of daylight savings (this ...
0
votes
1answer
31 views

Why the auto reboot not working?

Why the system is not rebooting? i have this following in the crontab under root username. uptime: 08:43:06 up 10 days, 13:28, 2 users, load average: 0,17, 0,08, 0,06 but it should be rebooting ...
0
votes
3answers
126 views

Magento PHP cron job fail to open required php files

We are trying to set up cron job for Magento site. We tried this Job, but it didn't work for us: */5 * * * * php -f /var/www/html/sitename/cron.php To debug we tried this Job: */5 * * * * /usr/...
1
vote
1answer
36 views

How to Defrag XFS

I have a /home partition in a separate disk with XFS, how do I de-fragment it ? (on-line or off-line) I haven't tried anything yet and the / partition has BTRFS. Also how to schedule it would be nice....
0
votes
1answer
41 views

SSH fails in Crontab after reboot

I am regularly running a shell script through Crontab that uses SSH to connect to a server. If I run that script manually it runs through successfully. Within the same session Crontab will ...
0
votes
1answer
95 views

run php file from cron and start browser through exec on ubuntu [duplicate]

I am trying to start FireFox from php script using exec("firefox"). This works fine if i run php file from the terminal but does not work when run by the cron. User for cron & terminal is root. ...
1
vote
1answer
119 views

Rebooting computer using cronjob doesn't work

I have a kiosk application running on Ubuntu Server 14.04. In my kiosk app there is a link to reboot the system which just defaults to some PHP page that run: exec('sudo reboot'); If the user ...
1
vote
0answers
29 views

Why might this “reboot on ping fail” script not be working?

I have an unresolved problem with my vps falling off the network. There's no reply and the webhost have no idea, so I thought this bash script should work #!/bin/sh ping -c5 8.8.8.8 if [ $? -eq 0 ]; ...
1
vote
0answers
66 views

Not able to execute a url from python script running via Cron

I have a script web.py which I am trying to run on the aws EC2 Instance using cron. It basically has these line of codes: import webbrowser webbrowser.open('http://xxxxxxxxxxxxxxxxxxxxxxxxxxxx') If ...
0
votes
0answers
36 views

How to start a Python script in LXTerminal using crontab at boot-up

I have a script called myscript.py (in /home/pi) that I want to run in the terminal every time the Pi boot up. I want to activate this by using 'crontab'. However after searching and trying stuff ...
1
vote
0answers
40 views

Can't start a job with Cron on Ubuntu startup

I am trying to get a simple Python script running on startup with Cron on Ubuntu 16.04. What I did is opened cron with: sudo crontab -e and added the last line as shown in the screenshot: I even ...
0
votes
2answers
80 views

How to set up cron to call php script - bash: */5: No such file or directory for setting cron job

we are trying to set up cron for magento site running in ubuntu server we are trying following command : */5 * * * * php -f /var/www/html/sitename/cron.php but we are getting error as below : -...