Cron is a job scheduler that allows users to run commands periodically.

learn more… | top users | synonyms (1)

0
votes
3answers
29 views

Add cron to Crontab

I am looking at these tutorials https://www.digitalocean.com/community/tutorials/how-to-use-cron-to-automate-tasks-on-a-vps and I have cron installed but when I write the command 5 * * * * curl ...
5
votes
2answers
27k views

Cron job to delete files older than 3 days

I need to remove files older than 3 days with a cron job in 3 different directories. (these 3 directories are children of a parent directory /a/b/c/1 & /a/b/c/2 & /a/b/c/3) Can this be done ...
0
votes
1answer
14 views

Getting cron to include Date IN error log

So I have the following Cron job running: /home/ubuntu/scripts/austria/archive.sh >> /home/ubuntu/logs/austria/archive.log 2>> /home/ubuntu/logs/austria/archive.err Every time the scrip runs, it ...
4
votes
2answers
442 views

systemd - Timer units that mimic anacron behaviour

I need to write a timer unit for a machine which is turned of frequently (e.g. classical desktop setup). This timer unit needs to be activated regularly but not very often (e.g. weekly, monthly). I ...
0
votes
0answers
27 views

How to show Java dialog when cron runs the Java program?

I've done a little java program that ends showing a dialog after doing some other tasks like reading from a web and writting on a file. My goal is to make it run everytime my system starts with 90 ...
2
votes
4answers
6k views

Installing crontab using bash script

I have created a script to install two scripts on to the crontab. #!/bin/bash sudo crontab -l > mycron #echo new cron into cron file echo "*/05 * * * * bash ...
8
votes
3answers
2k views

Run Script once a day with systemd

I want to run a backup script 10 minutes after booting up my machine but only once a day. Is it possible to build up such scenarios with systemd?
2
votes
1answer
488 views

how to temporarily disable a user's cronjobs?

How do I temporarily disable one or more users' cron jobs? In particular, I do not want to suspend the user's cron rights - merely not fire any of their jobs. I am on SLES 11 SP2 and SP3 systems
1
vote
2answers
61 views

Cron only occasionally sends e-mail on output and errors

On Debian 8.1, I'm using a Bash feature to detect whether the stackoverflow.com website is reachable: (echo >/dev/tcp/stackoverflow.com/80) &>/dev/null || echo "stackoverflow unreachable" This is ...
0
votes
0answers
6 views

Cronjob and Mapcrafter for Minecraft not running the renderer

I am using two Raspberry Pi 2 computers: one to run a Minecraft Server, one to run Mapcrafter (http://mapcrafter.org/index) to setup and update the server's map on my Apache2 server. I am using cron ...
0
votes
1answer
24 views

Output date is not proper when the script is ran using cron

The below line should provide an output date which when ran manually gives an proper output like Fri Jul 17 01:42:07 2015. But when ran using cron gives the epoch date i.e. Wed Dec 31 19:00:00 1969 ...
2
votes
1answer
3k views

mail: cannot send message: process exited with a non-zero status

I've had a cronjob working for about a fortnight without any problems. Then last night I checked I didn't get the email that I usually get. I went to the terminal to try send myself an email, I got ...
8
votes
2answers
21k views

Crontab job start +1 min after @reboot

Need a script executed at each reboot in +1 minute. I placed a record @reboot but it is too early for my script. How to execute it sometime after reboot?
1
vote
0answers
16 views

running cron on a chroot

For my web development I use a debootstrap'ped Debian with sysvinit, I start apache2/mysql manually only when I need to work. Now for a new project I require to run some scheduled task for which I ...
0
votes
0answers
50 views

Script won't run in cron but runs fine in root shell

My Problem: I have a python script that runs fine when run manually but does not complete when run using cron. My script fails in cron because it contains pexpect commands that require an interactive ...
0
votes
1answer
748 views

openSuse, not running the cron job

I have created a cron job in the /etc/cron.d/dispatchingEmail_I the permissions of dispatchingEmail_I are the following: -rw-r--r-- 1 root root 84 Sep 11 19:52 dispatchingEmail_I content of ...
20
votes
2answers
1k views

Can grep | crontab destroy all jobs?

My colleague ran grep | crontab. After that all jobs disappeared. Looks like he was trying to run crontab -l. So what happened after running the command grep | crontab? Can anyone explain?
0
votes
2answers
24 views

Insert Line in Multiples Files

I have a CentOS Server with 200 Wordpress sites and now I want to insert this line in every wp-config.php file: define('DISABLE_WP_CRON', true) I know there exist a "for ... do ... done" ...
0
votes
1answer
33 views

I cannot kill crond - trying to stop cron service

This is frustrating, I try: service crond status And get this: Redirecting to /bin/systemctl status crond.service crond.service - Command Scheduler Loaded: loaded ...
2
votes
0answers
27 views

Why a crond can start late randomly

I have this issue of a cron that executes a PHP script at minute 20 every hour, This script generates a small number of reports based on data from a MySql database. Generally this script ends ...
0
votes
1answer
59 views

Script with curl works manually but not in cron job

My script (status.sh) is: #!/bin/bash SITE=http://www.example.org/ STATUS=$(/usr/bin/curl -s -o /dev/null -I -w "%{http_code}" $SITE) if [ $STATUS -eq 200 ] then echo $STATUS >> ...
1
vote
1answer
37 views

Prevent ssh-keyscan from generating output

Problem: When running ssh-keyscan in cron it emails me the output of ssh-keyscan every day. The email simply contains the following. # <hostname> SSH-2.0-OpenSSH_5.3 My (simplified) cron ...
2
votes
1answer
45 views

How run free command by crontab

I want to run this command: free && sync && echo 3 > /proc/sys/vm/drop_caches && free -m by cron that why I'm able to free my RAM and cache in ubuntu system. I'm using ...
0
votes
2answers
236 views

Why does OpenSSL automatically send me Terminal mail?

I for some reason am getting messages from OpenSSL constantly (not literally constantly, but every hour or so) sent to my Terminal mail box saying: Message 1: Subject: Cron ...
1
vote
1answer
27 views

Have cron check if the bash script is executing

I have a bash script that users while do along with sleep to constantly monitor the connection state and take measures in case something goes wrong. The only thing that is not guarded is the execution ...
4
votes
1answer
40 views

Does rsync over any type of checksum? [duplicate]

I need to transfer files from several servers to a single remote host using Rsync over SSH. However, I need to be sure that before the file is deleted on the source using the --remove-from-source ...
2
votes
1answer
39 views

crontab versus manual running script

I wrote a script to check for wifi connection that has an "if then else" statement. If I run the script manually the "if" statement is 1, as it should, if the crontab runs it automatically the "if" is ...
0
votes
1answer
25 views

How to make OpenVPN to autoreconnect to gateway at any time

I've recently discovered a built-in way to have OpenVPN to auto connect to VPN gateway on startup, which is via setting profiles .conf files in /etc/default/openvpn as a part of AUTOSTART parameter. ...
0
votes
2answers
27 views

Simple bash not running properly by cron

I created a small bash script that takes a file using wget and then processes it using a php. The code goes like this: wget -U mozilla -P /home/logfetcher/ http://fakesite.com/log.`date -d ...
2
votes
4answers
3k views

Stop cron sending mail for backup script?

I have set up a backup script to back up world data on my Minecraft server hourly using cron, but because the worlds being constantly edited by players, tar was telling me that files changed while ...
3
votes
2answers
721 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
0answers
21 views

How to override email address used by at command

cron has MAILTO setting to explicitly configure the email address that will receive the report Does at have anything of the kind? Man page says it will send using /usr/sbin/sendmail but which ...
1
vote
1answer
56 views

Cronjob is running every minute but not at a specific time

As title says the job works if set like this: */1 * * * * /usr/bin/php /home/test/cron/test.php And if set to something like: 15 20 * * * /usr/bin/php /home/test/cron/test.php it's not working. ...
1
vote
1answer
59 views

Shell Script does not send email from Cron job [duplicate]

I have a shell script which sends email when the disk is more than 80% full; when I run the script as sh -x script.sh or ./script.sh I get an email but when I keep the script in cronjob I do not get ...
0
votes
0answers
21 views

Move files that are 7 days or older, cronjob [duplicate]

I want to move some log files that are 7 days or older to another folder and then delete those files after another week. I'm using logrotate to create a new log file every 2 hours in a folder. I ...
0
votes
1answer
23 views

Clear X clipboard using cron [duplicate]

Is there any way I can clear the X clipboard from a cron job? The usual commands for xclip don't seem to work. echo -n | xclip -selection clipboard doesn't work from cron.
2
votes
3answers
140 views

Shell script executed with cron results in different size file than executed manually

I have a RHEL server that I am running a MySQL database on. I have a Bash script that executes mysqldump that creates a backup file. The backup file created when executing the script directly in ...
25
votes
3answers
113k views

How can get a list of all scheduled cron jobs on my machine?

My sysadmin has set up a bunch of cron jobs on my machine. I'd like to know exactly what is scheduled for what time. How can I get that list?
0
votes
1answer
42 views

AWS CLI - not working in a crontab

I can run the command aws --version in a script and in the cli. But if I put this command into a crontab it does not work. Crontab: 50 12 * * * aws --version > ~/yolo.swag Error: /bin/sh: 1: ...
0
votes
3answers
30 views

Cron service running but not visible by “top”

I'm on my freeBSD server. Cronjob suddenly stop working. When I run "top" the service is not listed. But when i check "service cron status" , it is running with given PID. I restarted the service ...
1
vote
2answers
70 views

What's the most efficient way to log crontab shell script errors with error occurred time?

A common way to log crontab task errors looks like below: 1 */8 * * * sh /pseudo_path/test.sh 2>> my_err_log It's a concise command, but it can't record the error occurred time, and the path ...
2
votes
3answers
59 views

Transfering mp3 files from a remote server via cronjob to the RPi without overwriting

I succeded in transfering all files from a folder via ftp from a remote server to a raspberry, but I would like to transfer only new ones. Below is the working script i have. #!/bin/bash -vx ftp -in ...
0
votes
1answer
34 views

(SOLVED) how to close epiphany through a script with cron?

I have been making scripts to open and close a speficic website, with a cronjob, on the raspberry Pi. The opening script works perfectly. It is as follows: #!/bin/bash export DISPLAY=:0 && ...
2
votes
0answers
86 views

Configure job to expire

I'm learning Linux at the moment and were doing some exercises scheduling jobs with cron and crontab, but I'm wondering if it's possible to limit the amount of times that the scheduled job is ran. ...
4
votes
2answers
408 views

Mysterious “unable to resolve host” in dead.letter

In the ~ directory of the root user on my debian wheezy server regularly appears file named dead.letter with (currently) the following content: orion : Jul 25 10:17:31 : root : unable to resolve host ...
-1
votes
2answers
96 views

shell script not running using crontab

This is my script mboxutil -l > n.txt sed 's/^.*user//' n.txt > n1.txt cat n1.txt | sed 's/^.//' > n2.txt sed 's/\/.*//' n2.txt > dss_list.txt rm -f n.txt rm -f n1.txt rm -f n2.txt sed ...
15
votes
3answers
15k views

Does RHEL/CentOS execute all cronjob files under /etc/cron.d/*, or just some of them?

This is a Red Hat Enterprise Linux 5 system (RHEL). We manage this system using CFengine. We have several cronjobs which are running twice as often as usual. I checked the cronjobs under /etc/cron.d/ ...
2
votes
1answer
46 views

Hourly cronjob does not work

So just to sketch the outlines of this problem, i made an cronjob that should be executed on each full hour like this: 0:00, 1:00, 2:00. In all the manuals/tutorials i found on the internet they say ...
1
vote
2answers
138 views

CasperJS and PHP In Cron Job Cannot Open Files, Works Fine When Run Manualy

I recently got a new DigitalOcean LEMP environment with Ubuntu. I tried making an SH script that uses CasperJS to scrape data from an external website to a JSON file, and a PHP script to parse the ...
0
votes
2answers
41 views

Not all shell scripts working with crontab

I know this is a pretty broad title but I didn't know what to start with. Anyway, straight to the point. I have a little VPS I run apache and a Minecraft server on. I don't ever turn it off, but ...