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

learn more… | top users | synonyms (1)

2
votes
3answers
137 views

Read each directory and perform actions in Bash script

I have this directory structure at /var/sync: # tree -d /var/sync/ /var/sync/ ├── sync_bi │   ├── replicator => Replicator.php │ sync.php ├── sync_pfizer │   ├── replicator => Replicator.php ...
0
votes
0answers
150 views

Centos7 - crontab not running

I want to write a crontab that opens a firefox every minute (just to test it, i know it doesn't make any sense) My problem is that even though crontab is active nothing happens. This is how my crontab ...
0
votes
1answer
27 views

output logs in crontab does not work [closed]

I have a cron job it's on runnable .jar but I really want to check the output logs in console. but I wondered also if this command below will start to run on 3:15am but this jar takes time a lot of ...
1
vote
1answer
147 views

crontab -e yields: /var/spool/cron/: mkstemp: Permission denied

I'm trying to set up a cron job under my user. I run crontab -e, make my edits, and try to save and exit. I receive the following error message /var/spool/cron/: mkstemp: Permission denied. Relevant ...
1
vote
0answers
36 views

Change events order in bash script that writes to crontab

Coming from the solution on this post I have made a few changes to the original script but output is not like it should be. Below is the script as I have right now: #!/bin/bash add=$1 ...
56
votes
8answers
120k views

Where are cron errors logged?

If I setup cron jobs incorrectly they appear to silently fail. Where should I look for an error log to understand what went wrong?
3
votes
5answers
54k views

crontab -e , then 0 * * * * = every hour… Where is stored

After sudo crontab -e (it wrote "/tmp/crontab.XXXX70pN9h" 1L, 19C 1,1 All Then I saved the file. And to check..? (how? i don't know) And to check I ps -e | grep cron 29818 ? ...
0
votes
1answer
99 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
517 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 ...
2
votes
2answers
543 views

Is it possible to schedule a cron job to run fortnightly?

Is there a way to schedule a cron job to run every fortnight? (One way I can think of, within crontab, would be to add two entries for "date-of-month"...)
3
votes
1answer
55 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 ...
6
votes
1answer
20k views

How to run a cron job to execute every minute?

I am trying to create a directory having timestamp in its in name in the /home directory. I have created the following cron job as root user. But it's not running. What am I doing wrong? Following is ...
0
votes
1answer
24 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? ...
0
votes
2answers
619 views

Crontab error: no crontab For [user]

I'm seeing an error every time I do the command below. Why? $crontab -l no crontab for server where server is the user account. This issue comes about because the script in crontab doesn't work, ...
0
votes
1answer
455 views

don't log cron events in auth.log

In my /etc/rsyslog.conf, I have the following line to log the auth facility into /var/log/auth.log: auth,authpriv.* /var/log/auth.log but the file is flooded with cron logs, such as ...
1
vote
0answers
526 views

systemctl to start cron-like job

In /etc/systemd/system directory I have: rsnapshot-backup.service file, with following content: [Unit] Description=rsnapshot backup automation [cron like] [Service] Nice=19 IOSchedulingClass=2 ...
11
votes
4answers
39k views

How do I find out why cron is not running my jobs?

I'm using Ubuntu 14.04, and the cron daemon is running: # ps ax | grep cron 822 ? Ss 0:00 cron but it is not executing any jobs. I was previously getting entries in /var/log/syslog such ...
2
votes
1answer
86 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 ...
1
vote
1answer
50 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 ...
0
votes
2answers
73 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 ...
0
votes
2answers
50 views

Why can't I split cron logfile up from syslog in bangwagong host?

There are two vps: one is digitalocean, the other is bangwagong host. All the operating systems on them are Debian7. I want to split cron logfile up from syslog with the following steps. step1: vim ...
1
vote
0answers
69 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 ...
2
votes
3answers
139 views

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

I succeeded in transferring 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 ...
37
votes
9answers
69k views

How can I run a cron command with existing environmental variables?

How can I run a cron command with existing environmental variables? If I am at a shell prompt I can type echo $ORACLE_HOME and get a path. This is one of my environmental variables that gets set in ...
0
votes
1answer
21 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
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 ...
3
votes
1answer
122 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 ...
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" ...
0
votes
1answer
22 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
181 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 * * * ...
3
votes
5answers
777 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? ...
1
vote
3answers
283 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 ...
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 ...
1
vote
3answers
142 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 ...
19
votes
2answers
73k views

crontab's @reboot only works for root?

man 5 crontab is pretty clear on how to use crontab to run a script on boot: These special time specification "nicknames" are supported, which replace the 5 initial time and date fields, and ...
1
vote
1answer
83 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
751 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 ...
2
votes
2answers
942 views

Suddenly lost all cronjobs

All of a sudden my cron jobs don't work any more. When I type crontab -e I am presented an empty file in the editor /tmp/crontab.3fMYGi/crontab And by empty I mean that not even this standard ...
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
1answer
655 views

Why does redirection in crontab result in a zero byte file?

System: Xubuntu 13.10 When I have this crontab entry */5 * * * * cat /home/dbk/.bash_aliases &> /home/dbk/Desktop/junk junk has a byte size of 0. Running $ cat /home/dbk/.bash_aliases ...
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
47 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
31 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 ...
0
votes
2answers
72 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 ...
1
vote
2answers
438 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 ...
14
votes
2answers
20k views

Cron log on debian systems

On Redhat systems cron logs into /var/log/cron file. What is the equivalent of that file on Debian systems?
3
votes
4answers
270 views

Only allow process to run between hours x and y

I use a mobile data connection service. I only have unrestricted bandwidth between 9am and 4pm. I wonder how I can "silence" applications such as the Dropbox applet outside that schedule. I thought ...
8
votes
8answers
5k views

cron Vs. sleep - which is the better one in terms of efficient cpu/memory utilization?

The Case: I need to run some commands/script at certain intervals of time and for this I have two options - 1. set up a cron-job or, 2. implement a loop with sleep in the script itself. Question: ...
0
votes
3answers
3k views

Sending cron output to email?

I'm trying to send cron output to an email address and am struggling... I'm running the following command: 13 15 * * 1-5 root /path/to/mysql-backup.sh 2>&1 | mail -s "Daily Database Backup ...
1
vote
1answer
2k views

Pimp rsyslogd to have less i/o (cron, pam,…) and less logging

On my raspberry I really don't need crons and pam logging and I want to have less i/o to make the SD card life a little longer.. I have already removed cron with the second line cron.none, I'm ...