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

learn more… | top users | synonyms (1)

0
votes
1answer
154 views

Execute a command every minute forever using 'date'

I'm looking for a way (bash script or other) to make a command run every minute using date - I've been looking around for similar solutions but they all suggest either cron or watch but what I want to ...
6
votes
3answers
657 views

Create cron jobs to repeat every X units of time starting on an arbitary unit

I have a cron job on CentOS that I want to execute every 3 minutes but I have many other cronjobs that run at every 3 minutes starting from 0, 3, 6, 9... So, to avoid my server getting too overloaded,...
3
votes
1answer
62 views

Soft raid1 schedule resync

Debian has a cronjob /etc/cron.d/mdadm that starts a raid check (& resync?). It costs a lot of IO and can take up to 96 hours on 3TB disks. At this time the performance of the service will go ...
0
votes
1answer
27 views

Security of password in a cron job on a VPS

I have a site hosted on a VPS and need to run a MySQL dump nightly. If I create the cron command: mysqldump -u user -ppassword database | gzip > /path/to/zip/file are there any security issues? ...
2
votes
1answer
163 views

`crontab -e: E212: Can't open file for writing` when using gvim (works with vi)

As a user, I want to edit my crontab. crontab -e gvim is launched. It prints "/tmp/crontab.IUVYhK/crontab" [New DIRECTORY] I can write but as soon as I try to write the temporary file, I get ...
0
votes
2answers
121 views

My backup is not working when started by Cron

For some reason, my backup is not working, when it is started by cron. Crontab entry 0 10 * * * /home/yzT/BackupDaily.sh BackupDaily.sh #!/bin/bash /home/yzT/Tools/FreeFileSync/FreeFileSync /home/...
1
vote
1answer
53 views

When a cronjob really starts?

My question comes from an observation that I made while seeing an every minute cronjob running like that: 12:00:15 (cron started) 12:01:20 (cron started) 12:02:02 (cron started) . . . As it seems ...
1
vote
0answers
84 views

ssh command runs manually but not in cron [closed]

Below script is working fine when ran manually but failing for the servers usl20016089 and usl20016087 when scheduled in cron with this error: Request exec channel error: Authentication failed Here ...
0
votes
1answer
25 views

I lost my mail spool

I while ago I wanted to have messages from cron sent to my mail address so I installed ssmtp. But then I decided that I'd rather receive the messages in the file under /var/mail as usual, so I removed ...
0
votes
1answer
23 views

cron not executing

i have a cron in my crontab 45 18 * * * root /bkp_db.sh but it is not working. it is not being executed. what im doing wrong? Inside my script: NOW=$(date +"%Y-%m-%d") mysqldump -u root apps_db &...
2
votes
5answers
247 views

crontab -e not working

I'm running these commands on crontab and it seems that the script are not running every 5 minutes 5 * * * /etc/my_scripts/telnet.sh | telnet >> /tmp/top_Jay.txt 5 * * * /etc/my_scripts/...
1
vote
3answers
364 views

Excluding specific date and time in cronjob

I am trying to schedule a cron job where the requirement is the job has to run every day, every month and every min and every hour EXCEPT 2nd and 4th sunday of every month from 1 to 3 AM. Is there a ...
1
vote
3answers
2k views

How do I create a service for a shell script so I can start and stop it like a daemon?

I'm using CentOS 7 what my aim is to create a cron for every five seconds but as I researched we can use cron only for a minute so what I am doing now is I have created a shell file. hit.sh while ...
1
vote
1answer
204 views

cronjob at resume from suspend

using linux. I know you can do an @reboot cronjob. I want to do an equivalent thing but instead of running at reboot, running after my computer awakens from suspend. Is that possible?
6
votes
2answers
2k views

script to check if SSL certificate is valid

I have several SSL certificates, and I would like to be notified, when a certificate has expired. My idea is to create a cronjob, which executes a simple command every day. I know that the openssl ...
3
votes
5answers
843 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
52 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
43 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
62 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 * * * * * /usr/local/...
1
vote
1answer
77 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
54 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 repository,...
1
vote
2answers
1k 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
141 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 /root/libvmi/...
2
votes
2answers
114 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
75 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
27 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
225 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
303 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
159 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
174 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
60 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
116 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 && /sbin/dirvish-...
2
votes
1answer
2k 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
104 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
39 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
2answers
1k 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 %H:%M:%...
17
votes
1answer
558 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 http:/...
0
votes
1answer
63 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
71 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
72 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
269 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
133 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
231 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" ...