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)

2
votes
1answer
169 views

Help, ubuntu server 14.04 crontab cannot run my database backup script, but other simple script is ok

Hi All Ubuntu Server Experts I need help in cracking this crontab problem. So, I made a change in /etc/crontab to run a system script for database backup purpose. The crontab does not seems to run my ...
0
votes
0answers
14 views

Timezone CRON issue

I wanted a CRON job on my server to run at 5 AM GMT every day, so that according to my timezone (IST), it'd send an email at 10:30 AM. Here's my date and timezone settings: ~# date Fri Jan 1 10:33:...
0
votes
2answers
60 views

cron.hourly sendmail errors even though my scripts do not involve sending mail [duplicate]

I have only one very simple shell script in /etc/hourly.cron. It just controls a Twitter bot- it runs a short python script that posts to Twitter using tweepy. It does not involve email or any ...
1
vote
1answer
92 views

Cronjob permission denied (Nightly backup shell script)

I am trying to create a shell script to make a backup every night using tar. The error I get is: From shady@wserver1 Wed Dec 30 04:01:01 2015 Return-Path: <shady@wserver1> X-Original-To: ...
0
votes
0answers
15 views

Automated backup script no longer running after upgrading to 14.04.3

I have a backup script that flawlessly backed up my system on an hourly basis, until I upgraded to Xubuntu 14.04 from Xununtu 12.04. I did not initially notice, since I just assumed it would keep ...
1
vote
0answers
54 views

crontab run sequentially

I have to run crontab in xvfb display mode forever when the system restarts...below is crontab code.... @reboot nohup Xvfb :1 -screen 0 1024x768x24 & export DISPLAY=":1" @reboot /usr/bin/forever ...
0
votes
0answers
115 views

What is Permission denied (publickey,gssapi-keyex,gssapi-with-mic)?

#!/bin/bash/expect for host in `cat jo.txt` do ssh -i /Users/Aparna/Desktop/Key/mfiosdev_rsa root@$host "timeout 4s curl -sL -w "%{http_code}\\n" "http://$host:9080/worklightconsole/" -o /dev/null -v &...
0
votes
0answers
19 views

Remind user of a backup task, for example once a week (Bonus: on shutdown)

I am looking for a kind of cron task that remindes (on my Xubuntu desktop) me once per week to do a backup (which is a rsnapshot shell script which should be started in a terminal to see the progress)....
0
votes
1answer
30 views

Script for checking internet connection and password request

Good morning, I have a home server running Ubuntu 14.04.3 LTS. It's a desktop connected to my wi-fi connection via an USB adaptor. The issue here is that randomly it gets disconnected from the ...
3
votes
1answer
167 views

cannot access crontab after changing uid

I recently changed the uid of my linux account (the reason for this change lies in the need to have a precise uid to access files on a mounted drive). Since then, I cannot access my crontab. After ...
3
votes
2answers
56 views

cron does not write in the file

I just start with cron jobs and I wanted to start with an easy task. Create a file in my home folder with the output of the ifconfig. So I created test.sh, which I made it executable with the: #!/bin/...
2
votes
2answers
50 views

How can I remove a cron job set as user ubuntu

I'm using Ubuntu 14.04 and I have created a new cron job as a different user. I started gksu gnome-shedule and set up a new cron and set it up as user ubuntu. Now I can't edit or remove this job. Is ...
4
votes
2answers
321 views

One single cron job not running

I have a list of cron jobs. 00 21 * * * sh ~/db_backup.sh 20 21 * * * sh ~/update.sh * 5 1 * * sh ~/db_vacuum.sh The first job makes a backup of a database I have running on an Ubuntu server, ...
0
votes
2answers
60 views

CRON: Starting new cycle while the last one is still running?

Example, there is 1 .py script set with CRON to execute every 5 minutes. What if that script takes more than 5 mins to finish? Would that cause the problem? Would .py program broke? Is it possible to ...
0
votes
0answers
18 views

How to run `updatedb` without `sudo` every hour? [duplicate]

I would like to keep the database updated every hour using crontab, are there any ways that I could do this without entering password every time? Thanks!
1
vote
0answers
57 views

Evernote: script that can incrementally download full db where note = file?

Is there any script to incrementally download my Evernote database in plaintext? I need to have not one big file but many files (with attachments) - I want to use cron for everyday backup to git and ...
2
votes
1answer
43 views

Cron Job Produces No Output

I am using the following cron entry to clean my Postfix queue: * * * * * mailq|awk ' /^[0-9A-F][0-9A-F]*.*MAILER-DAEMON$/ {print $1}'|tr -d '*'| xargs -rn1 /usr/sbin/postsuper -d > output.txt ...
3
votes
1answer
96 views

Bash script not working properly from crontab

I've some scripts that run perfect if you run them from a terminal, but once you add them to crontab it's like the bash doesn't execute properly and doesn't continue with the first IF statement and ...
1
vote
1answer
165 views

Run Android Studio on reboot using shell script

I'd like to start Android Studio while my computer starting. I used crontab and @reboot parameter: crontab -e and scheduled this task @reboot /home/ziko/reboot_cron.sh # JOB_ID_1 SHELL=/bin/sh ...
1
vote
1answer
93 views

mysql cron job - Email only when restarted

I've got the following cron job and it runs every 5 minutes (it actually works) #!/bin/bash PATH=/usr/sbin:/usr/bin:/sbin:/bin if [[ "$(/usr/sbin/service mysql status)" != *start/running* ]] then ...
0
votes
1answer
42 views

Cron job shut down the system ignoring the specified time

I made a script that asks the user if he wants to shut down the computer in 10 minutes or wait another hour and I scheduled in cron to run each hour from 18h to 7 am. However it happened two problems: ...
0
votes
0answers
35 views

Cron Shutsdown MySQL every day

I'm not a sysadmin, but I run several VPS on my daily work most of all for WP sites. In one VPS (DigitalOcean) 2GB RAM / 2CPUs 40GB SSD Disk my MySQL dies after a Cron Job Runs, here are my Crontab. ...
0
votes
1answer
51 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 ...
1
vote
0answers
74 views

How can simulate mouse clicks in a cron job on a headless machine?

I have a headless machine running Ubuntu 14.04 LTS. I'd like to set up a cron job to daily click some buttons on a web page. I often use X2Go, and I know I could manually open an X session and use ...
0
votes
0answers
100 views

Editing Gsettings from Cron via script doesn't work

So, I'm trying to change my theme from a light to a dark version in the evening, and vica versa in the morning. However, Gsettings doesn't work from Cron, and the solutions posted here and here don't ...
2
votes
2answers
70 views

Do I need to notify cron about changes in /etc/crontab?

I have edited the system crontab table using sudo nano /etc/crontab according to this question I found online. Will that be sufficient to run the job or do I need to "notify" or "refresh" cron with a ...
1
vote
1answer
188 views

How to change the day of the week Logrotate shifts the file when configured weekly?

I have following configuration which rotates all content of google folder weekly: /var/log/google/*.log { create 0777 www-data www-data weekly missingok rotate 90 ...
0
votes
0answers
62 views

Why does my Ubuntu server shut down the MySQL connection the same time every night?

At the same time every day (around 10 PM EST) my MySQL (now MariaDB) server goes offline and my sites crash. I can't for the life of me figure out why. When I look in the syslog I see that there are ...
0
votes
0answers
17 views

How to automate these cleanup commands using bash(?) [duplicate]

I wanted to know how to automate these commands: echo "Cleaning Up" && sudo apt-get -f install && sudo apt-get autoremove && sudo apt-get -y autoclean && sudo apt-get -...
1
vote
2answers
82 views

Why cron adds question mark after log file name

I have created cron task using crontab but I get question mark at the end of log file name. */4 * * * * /usr/bin/php /path_to_cron/queue.php > /path_to_log_file/queue.txt Is there any way to get ...
0
votes
1answer
52 views

Why isn't this cron job working?

I am using Ubuntu 14.04 and have created in the the following script inside /etc/cron.hourly and made it executable filename: remove_old_tmux_resurrect_saves #! /bin/bash ls ~/.tmux/resurrect/* -...
0
votes
1answer
139 views

Why do variables set in my /etc/environment show up in my cron environment?

For a long time, I have been used to thinking that any environment I wanted in cron, I basically needed to set in the crontab itself -- see the "Different Environment", likely top answer here: Reasons ...
2
votes
1answer
61 views

Stop incessant notifications

I wanted to schedule a job to run at a specific time just once. So, I used the at command: at now -f /path/to/task.sh Now, in the task script, I wrote code to display notifications using notify-...
1
vote
0answers
52 views

How to use Mutt as the mail transport agent used by crontab?

I am using Mutt to send emails from my server. Using the MAILTO variable to send the result of running crontab tasks is not working as it seems that it expects to find /usr/bin/mail. This is the ...
0
votes
1answer
46 views

Anacron can't read ssh keys?

I've set anacron under the non-root user as follows: mkdir ~/.anacron cd ~/.anacron mkdir cron.daily cron.weekly cron.monthly spool etc My anacrontab in ~/.anacron/etc: # /etc/anacrontab: ...
2
votes
2answers
204 views

Can't access shell variable in crontab configuration

I have problem in accessing a shell variable while running cron job. Actually i created a job which prints two shell variable values into a env.output file. I am writing cron job using command $ ...
2
votes
1answer
97 views

awk command unable to read apache log file (user error)

Stumped by this one: less, cat & grep are all able to list the content of an apache log file "/var/log/apache2/other_vhosts_access.log". But when I use awk to grab the last 5 minutes of the file ...
0
votes
0answers
108 views

Using csync to sync through SFTP from crontab (needs to, but doesn't use my .ssh/config)

Running the sync manually works: /usr/bin/csync .bak sftp://sftp-machine-dog@ram-htpc/bak And it gives csync.lock - Creating lock file: /home/kent/.csync/lock csync.lock - Create temporary lock ...
1
vote
1answer
817 views

Syntax error: EOF in backquote substitution

I scheduled following cron job: root@alexus:~# crontab -l | grep ^\@hourly @hourly OUT=`/usr/lib/nagios/plugins/check_disk --include-type=ext4 --warning=10% --critical=5%` ; if [ $? != 0 ] ; then ...
0
votes
1answer
222 views

LuckyBackup scheduled backup does not work

I am using luckyBackup 0.4.8 on Kubuntu 15.04. I created a profile to backup my data files. When executing the profile manually everything works fine. I also created a cron schedule to execute the ...
1
vote
1answer
116 views

Blender GPU rendering works from command line but not in crontab [duplicate]

I would like to schedule blender renderings with GPU support. I have created a bash file rendering.sh to do the job. I have scheduled it with sudo crontab -e. * * * * * sleep 0 ; sudo /Home3DHome/...
0
votes
1answer
72 views

Daily Cron job not executing

I created the following cron job under /etc/cron.daily/backup-vivashost #!/bin/bash DATE=`date +%Y%m%d` mkdir /var/lib/html-backup/www-$DATE/ cp -R /var/www/html/* /var/lib/backups/html-backup/www-$...
0
votes
1answer
80 views

Using KCron in Kubuntu 15.04

I tried to install KCron in Kubuntu 15.04. I could find the package in Muon but after installing it I can't find it in the application menu. Also I can't start it by running "kcron" in the console. I ...
0
votes
1answer
21 views

Which backup package can meet these requirements?

I am looking for a decent, simple to use snapshot package. It should accomplish the following: store several profiles for different jobs (ex. /home part, /root part, ) linkable to cron for daily ...
0
votes
1answer
120 views

Run cronjob in Ubuntu 14.04 Server

How can I run crontab in Ubuntu 14.04 server? I am using CodeIgniter PHP framework. I get some code from here and tried this: */5 * * * * wget -q http://IPADDRESS/ws/cronjob/index But this is not ...
0
votes
1answer
42 views

Why my cron Job does not work?

Here is my cron job: */10 * * * * export DISPLAY=:99 #this is to open a port by Xvfb */10 * * * * python Crawler.py #this file will use a selenium to script the data through firefox browser. ...
0
votes
1answer
106 views

@reboot works with command but not script - Cron

So I am trying to run a script as a specific user @boot. I have come across using @reboot in conjunction with crontab. I have found that @reboot is supported by both the user and root via @reboot ...
0
votes
0answers
12 views

Can't seem to get crond to run

Three different production server running Ubuntu Server 14.4. Two are doing wonderfully... but one, does not run cron at all upon bootup. The only thing that launches it is "sudo cron" after the ...
0
votes
0answers
37 views

run once at boot, login then logout

I can´t get PIA VPN to run until I login So, from a Wake on lan start, how would I get the machine to login (which will make PIA start) and then logout again, or wait till lock will do. Ideally I ...
0
votes
1answer
52 views

Cron job not working

I have a script at ~/.sst/cmd.sh. It takes screenshot and saves after creating a date heirarchy of folders. Here's Content: #!/bin/sh mkdir -p --mode=0755 /home/username/.sst/rslt/$(date +%Y)/$(date +...