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
37 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
34 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
0answers
43 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
69 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
85 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
61 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
149 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
54 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
79 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
50 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
120 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
59 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 ...
1
vote
0answers
48 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
40 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
193 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
91 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
91 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
657 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
194 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
98 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 ...
0
votes
1answer
64 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/* ...
0
votes
1answer
69 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
110 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
40 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
96 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
35 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
51 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 ...
0
votes
1answer
339 views

Unprivileged LXC Container fails to boot on startup with 'call to cgmanager_create_sync failed'

I have some issues trying to start an unprivileged LXC container in my machine. $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04.3 LTS Release: ...
1
vote
1answer
1k views

Use crontab to restart an Upstart service on schedule?

I need to restart shiny-server (Upstart service) on Ubuntu 12.04 on a routine schedule. Typically, if I want to restart this service manually, I simply type: sudo restart shiny-server or service ...
12
votes
2answers
765 views

Announce the time on the hour?

On the mac there is a feature which allows you to get your computer to verbally announce the time on the hour, is there something similar on Ubuntu? That is is there a package which already does this ...
1
vote
1answer
145 views

How to use Incron and date?

I have the following code: /var/www/html/wp-content/uploads/2015/09 IN_CREATE,IN_CLOSE_WRITE /opt/imageopt$ how can i set the "/2015/09" part to todays date? Thanks,
0
votes
0answers
30 views

detect whether block device (drive) has been read from

So, since hdparm doesn't really work for some obscure reasons with my SATA drive when I want it to spin down the drive after X minutes, I've been searching for alternative options and found one using ...
0
votes
0answers
21 views

looking for a nagios or ruby expert to help me get away from bad bash practices

Granted the problem: I want to; mount, copy files, and unmount; automagically when drive is connected, I see the following 2 options (i'm sure there are more concise ways I'm not aware of).. maybe ...
1
vote
1answer
561 views

Docker is managed via upstart, try using service docker

I'm using following system: root@alexus:~# cat /etc/issue.net Ubuntu 14.04.3 LTS root@alexus:~# uname -a Linux alexus 3.13.0-57-generic #95-Ubuntu SMP Fri Jun 19 09:28:15 UTC 2015 x86_64 x86_64 ...
2
votes
1answer
204 views

What is the cron file of three times per month, from 3-5 pm?

I want to run a job three times per month from 3-5 pm. Hence, I should add a line to /etc/crontab which satisfy those needs. How do I add this line known that I try the following, and it seems ...
0
votes
0answers
147 views

`/usr/sbin/apache2 -k start` eats lots of memory

When I do ps -aux in my server, I get the below output. It seems apache eats lots of memory. What is causing this? I am running 3 cronjobs every minute in php. Is that causing this? www-data 1397 ...
3
votes
1answer
151 views

Save only specific output to log file

I'm using unison to synchronise data to a server, and I've recently created a cronjob for this. The cronjob is running at startup and saves the output to a log file. (additional info below). The ...
0
votes
1answer
61 views

arecord does not work with crontab

I am having a problem with cron job recordings. I can run arecord from tcsh scripts as the same user as the GUI from a terminal, but it will not run from crontab. The crontab user is the same as the ...
1
vote
1answer
63 views

How do I identify which log is incorrectly rotated?

I'm receiving email prompts from two Ubuntu 14.04 servers around unusual logrotate behaviour. I don't have any packages installed which are not installed on other servers which don't exhibit this ...
2
votes
1answer
44 views

how to do an on-change one-way sync/backup between folders on primary drive to secondary drive?

I have two HDs in my machine. All of Ubuntu is installed on the main drive. The 2nd HD is empty and is for backup purposes. I want to configure a one-way sync/backup of /home/* to the 2nd HD. I know ...
1
vote
1answer
390 views

Ubuntu 14.04 randomly freezes after long periods and fails to reboot automatically (crontab)

For some time now I've been having problems with my ubuntu 14.04 installation on my assembled pc. The main component is the motherboard, an ASRock Q1900M Pro3, 4gb ram, and two pci sata controllers. ...
0
votes
2answers
252 views

Backup with rsync works but not in crontab

Using this command in rsync: rsync -azvh pi@192.168.1.45:/media/PNY/video /home/john/Desktop/Pi\ Videos Works flawlessly. Now, when I put this command in crontab to run every 15 minutes, it does ...
0
votes
1answer
699 views

How is trim enabled in Ubuntu 15.04? [duplicate]

Does it work once a week or does it continually trim the system? I have seen answers for this but they refer to Ubuntu 14.04 but not to Ubuntu 15.04
0
votes
0answers
187 views

Java JDBC: Connection Timed out - Executing a jar file in shell script scheduled as cron job

I have a requirement of updating a db data. Db is stored on a remote server. I am using an executable jar file that connects to this db using JDBC and parses locally stored files and updates the db ...
0
votes
0answers
77 views

Cron Jobs shut down times

My cron job looks like this in Ubuntu 14.04: 00 2 * * 1-5 /home/ritzie/dm_hibernate.sh 00 2 * * 6,0 /home/ritzie/dm_hibernate.sh So during the week it comes on at 5pm and boots off at 2AM. On the ...
4
votes
1answer
132 views

Ubuntu touch and cron jobs

I created a script to enable flight mode at night and disable it in the morning. I'm adding checks to avoid enabling it if there is phone of web activities. The script has been added to cron (5 minute ...
1
vote
1answer
135 views

How to configure a script to start automatically after server reboot

I want to configure a script to execute automatically when a server is rebooted. Currently I need to start the script manually after server reboot. I am using Amazon Linux server. I was able to ...