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

learn more… | top users | synonyms (1)

2
votes
2answers
68 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
26 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
211 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
38 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
290 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
149 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
148 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
58 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
27 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
111 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
1k 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
92 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
38 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
52 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
828 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 ...
17
votes
1answer
552 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
57 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
68 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
68 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
241 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
110 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
39 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
219 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
39 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
37 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
261 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
787 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
179 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
209 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
41 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
72 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
64 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
1k 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
37 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
39 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
316 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
870 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
25 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
261 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 ...
0
votes
1answer
72 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.
0
votes
1answer
939 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
53 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
161 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 ...
0
votes
1answer
414 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 && ...
4
votes
2answers
557 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 ...
0
votes
2answers
329 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 ...
2
votes
1answer
57 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 ...
0
votes
2answers
160 views

Dynamic change of Linux root password everyday

I want to change my root password everyday based on the date. The password will be like a combination of a string and the date. The below code is working fine. echo -e "pass"$(date ...