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

learn more… | top users | synonyms (1)

3
votes
5answers
781 views

Is it possible to enable/disable SSH using cron

I would like to disable the ssh server for certain times of the day. I would like to do this because I recently experienced a brute force compromise via ssh. Can crontab be used to enable/disable SSH? ...
2
votes
2answers
51 views

How I can ignore transient failures in scripts run by cron?

I have various backup-style scripts which run from cron on a headless server (Ubuntu 14.04), typically on a daily schedule. Cron is configured with a mail server so I get feedback from jobs. Normally ...
2
votes
1answer
41 views

Cron not keeping to specified time

I'm running crontab on Ubuntu 14.04, on DigitalOcean's VPS service. I've made a web scraper to do a job every two hours. My issue is, cron disregards the hours I've set and follows the minute ...
1
vote
0answers
47 views

Cron “cowardly” refuses to run a job [closed]

I have a strange issue running a script via cron. I've got it installed on several identical machines(CentOS 6.5), some are working some are not. the job it self looks like this * * * * * ...
1
vote
1answer
48 views

My cron is not running, nothing is showing in /var/mail/<username> or in /var/log/syslog

kenneth@ballotreport:~$ crontab -l # Edit this file to introduce tasks to be run by cron. # # Each task to run has to be defined through a single line # indicating with different fields when the task ...
1
vote
1answer
32 views

Latexmk, from Makefile, from bash script, from Cron - Latexmk not being executed

I have several Git repositories with LaTeX files that I want to have typeset automatically. The idea is to have a central bash script (run by a cronjob) that executes a bash script in every ...
1
vote
2answers
448 views

Cron Bash Script - echo to current terminal instead of /var/spool/mail/root

Is it possible for a Cron Bash Script to echo to the current session terminal instead of /var/spool/mail/root I have a script which writes errors to a log file but any supplemental/unimportant info I ...
0
votes
2answers
73 views

Crontab CentOS blank output .txt file

i am configuring cronjob to output every minute but it ended up having an empty txt file (hello.txt) in root. These are the files and codes used: Testcron.sh file: #!/bin/bash ...
2
votes
2answers
73 views

RSync Error in script

At my job, we have a central Backup server, running Debian Wheezy, and on-site servers at each site, also running Debian Wheezy. A few weeks ago, the central office tech emailed me that the backup ...
2
votes
2answers
51 views

Run and stop a monitoring command as sudo for s seconds every m minutes

I want to run sudo airodump-ng -w myfile every ten minutes or so, for m minutes. It does not matter if the running time shifts (that it, if it runs m minutes later each time). Notice that this is a ...
1
vote
2answers
20 views

Cronjob based on system time or its own time elapse

Cronjob is based on the system time or its own time elapse? If it is system time, when I change the system time manually, will cronjob follow the new set up time accordingly?
0
votes
1answer
154 views

curl and wget cut off url

I have a web cms that allows so called action IDs which are urls. When you hit those, they perform some code in the cms. So I wanted to perform an action periodically and used cron for that. PROBLEM: ...
0
votes
1answer
33 views

CentOS Crontab - Extract particular file name

Let's assume that I have a file with extension of .7z and I have a crontab that extracts this file. But the name is unknown, only the extension is known, is it possible to extract it from crontab? ...
0
votes
2answers
234 views

What user should I create and execute cron jobs as? Apache? Root? Me?

I'm setting up a new Webserver and having trouble getting cron to execute as expected. I am using a script to create cron jobs in .tmp/crontab.txt, which is then moved to /var/spool/cron under the ...
2
votes
2answers
80 views

Why is mail-utils / cron sending out so many emails?

I was trying to troubleshoot why my Raspberry Pi isn't sending emails with ssmtp / mail-utils, and so I opened up my gmail account that I use for the Pi. To my surprise, there were 15k unread emails ...
3
votes
2answers
87 views

Is it possible to store user's crontab in user's git repository on OpenBSD?

On OpenBSD and with OpenBSD's cron and crontab, is it possible to store the crontab(5) of a user in a git repository of the same user? What would be the proper way to accomplish something like this? ...
-1
votes
1answer
52 views

cron job with slash

I got a cron format like this: 0 0 12 1/1 * ? *, How to read it and what does it mean. I understand things without slash but not this one.
0
votes
1answer
23 views

Where is the users cronjob

i have build a cronjob for a single user www-data user by using sudo -u www-data crontab -e i'm trying to find where this file is saved, i have looking in /etc/crontab but its not here, soe i can't ...
1
vote
1answer
83 views

Perl script is running fine in interactive shell but not as a cron job

I have installed dirvish for some backups. I have initialized one vault (host). And now I am using the following script to run it: #!/bin/sh /sbin/dirvish-expire --quiet && ...
2
votes
1answer
568 views

fstab mount, boot stuck on “A start job is running for dev-disk-by\…”

I am running debian 8.1 and working on this for hours now! I try to auto mount seagate and medion on boot if they are plugged in, but if the server is booting without one of these LABELs it stucks ...
0
votes
1answer
62 views

What would crontab do if the server is shutdown?

Say I have a crontab like: */30 * * * * /root/scripts/remove_log_files.sh This will remove some logs that I don't want every 30 mins. What would happen if the server shutdown after 25 mins the ...
-1
votes
1answer
34 views

error while changing directory using crontab [closed]

This is my script I am trying to rename the files in folder. rename1.sh ---------- #!/bin/bash cd /home/lanein1/WestonIN7pm/"$(date +%Y-%m-%d)" && rename s/WestonIN/WestonIN7pm/ *.jpg cd ...
1
vote
2answers
46 views

Cron job runs more often than I thought it should

I have a cron job that is running twice an hour. It runs once at HH:00 and once at HH:45. This is strange because I tried to specify that it should run every 45 minutes as follows: */45 * * * * ...
0
votes
1answer
362 views

Pushing to a Git repo from shell script

I'm trying to commit/push changes to a remote Git server with the below sample code: #!/bin/sh USER='username' REPO='/home/'${USER}'/Sites/git/bitbucket/kb' COMMIT_TIMESTAMP=`date +'%Y-%m-%d ...
16
votes
1answer
525 views

Correct capitalization of “cron”

I'm not quite sure what the standard is for spelling cron. Does one capitalize the whole word? Just the "C"? All lowercase? Is there even a standard, or do you just spell it in whatever way looks or ...
0
votes
3answers
36 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 ...
0
votes
1answer
42 views

Getting cron to include date in error log

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 script ...
0
votes
1answer
49 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 ...
0
votes
0answers
48 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 ...
2
votes
2answers
178 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 ...
2
votes
0answers
64 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
2answers
35 views

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

The below line should provide an output date which when run manually gives an proper output such as Fri Jul 17 01:42:07 2015. But when run using cron, it gives the epoch date i.e. Wed Dec 31 19:00:00 ...
0
votes
0answers
175 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 ...
21
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
35 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 exists a "for ... do ... done" ...
2
votes
0answers
35 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
136 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 ...
0
votes
1answer
406 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
120 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 ...
3
votes
1answer
124 views

How to 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 way I can free my RAM and cache in an Ubuntu system. I'm using ...
1
vote
1answer
39 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
57 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
52 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
548 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
36 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 ...
1
vote
0answers
35 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
169 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
381 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
24 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 ...
2
votes
3answers
210 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 ...