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

learn more… | top users | synonyms (1)

-1
votes
1answer
55 views

Cron does not execute my Python script [closed]

I'm trying without success to execute a Python script using cron on a Debian Jessie Raspberry Pi. I can execute the script manually, but it fails to execute with cron. Here's what crontab -l shows: ...
1
vote
1answer
131 views

Crontab and Tmux not playing well together

So I want my server to run a script which starts several tmux sessions on boot. This is my crontab: @reboot . /home/steven/.profile; /home/steven/Scripts/Start.sh And this is the content of my ...
1
vote
2answers
128 views

Not able to schedule tasks in crontab

[srinkann@sjc-ads-440 ~]$ crontab -e no crontab for srinkann - using an empty one /bin/sh: /usr/bin/vi: No such file or directory crontab: "/usr/bin/vi" exited with status 127 [srinkann@sjc-ads-440 ...
0
votes
1answer
24 views

Script for backup each DB on server but omit system databases

I have read a lot of post around this topic but I didn't found the one to fit my needs. So, basically I want to make two backups: one at mid day (12 PM) and the other at midnight (12 AM) for each ...
16
votes
3answers
23k views

how can I make cron run a job right now, for testing/debugging? without changing the schedule!

I have a cron job that is scheduled to run everyday, other than changing the schedule, is there any other way to do a test run of the command right now to see if it works as intended?
1
vote
1answer
36 views

Screen creation not working on crontab

I have a problem with one of my VPSs, in the main one, the command screen -dmS SCREEN_NAME node DIRECTORY (Create a screen without joining it with the command "node DIRECTORY") works normally, in ...
5
votes
1answer
3k views

Cron job still running when deleted

On a server I inherited, there is a cron job running hourly on one of the Debian servers. It sends an email out to a non-existent email, but bounces back to my account since I listed myself as the ...
2
votes
1answer
91 views

How do I run a script every time “yum update” is run?

I'd like to run a script (let's say myScript.sh) every time a yum update or yum install command is executed. So if I run yum update someprogram then myScript.sh should be executed right after that. ...
0
votes
1answer
312 views

How to add subject line when sending email output of find using ssmtp

I got a script running (as cronjob) that will list the files in a folder before doing a Rsync job and emailing me the list. How can I add a subject line. find /path/to/folder/ -type f -size +1M -name ...
1
vote
1answer
62 views

Java file is not getting compiled in cron

Can anyone please guide me with this. I run a script file through CRON daily which involves running selenium testcases and sending the report as mail. Here is my script: check.sh #!/bin/sh set -x ...
-1
votes
1answer
194 views

Cron task scheduling and stopping after certain interval [closed]

I am managing a server which has multiple cron tasks, one of the crontab entry is like below: 51 ​*/2 *​ * * /root/backup.sh can anyone explain me what is happening here, at what time the script is ...
2
votes
1answer
39 views

How do I set a script to randomly print to a user's SSH session without setting it up as a Cron job?

I'm managing a small server at work that we use for Samba and SSH. I'd like to mess around with my coworkers by having a script run at random times of the day where it fetches a random quote ...
0
votes
1answer
54 views

Cronjob to push MongoDB Backup via git

Task: Create a Cronjob that executes a bash script once every night. The bash script should do a mongoDB Backup and push it to a Git Repo. So I created a cronjob as the root user via the crontab -e ...
0
votes
1answer
122 views

a cron job to delete a specific file once it reaches more then 1gb size?

My server broke down with exenstive damages when a log file reached 27 gigs in a few hours. Log files are compressed daily, and are usually very small, maybe up to 10mb in 24 hours. Today there was an ...
0
votes
1answer
48 views

Running crons on a scaled mirrored servers (cron logic needed) [closed]

I have a client running on Rackspace, they have three servers that are synced together entirely, I've added a bunch of crons in the crontab using wget to the web address of the cron (that sync to each ...
1
vote
0answers
125 views

Problem using crontab playing beep sound

I'm trying to create something like a watch does. The beep sound indicating that an hour has been passed. So I opened the crontab(sudo crontab -e) and wrote this line(there are five asterisks just ...
1
vote
1answer
52 views

How to add change directory and git pull to this crontab line?

I have this directory structure: /var/sync/ ├── sync_bi ├── sync_pfizer └── sync_sandbox I have a few files running by the following cronjob: 10 */12 * * * find /var/sync/ -name 'Replicator.php' ...
1
vote
2answers
77 views

Script usually works, but not with cron

I have a script that looks like this: #!/bin/bash D=~/brew\ update num=$(ls "$D" | cut -d ' ' -f 2 | sort -nr | head -1) num=$(( num + 1 )) script -q "$D/brew_update $num" brew update This ...
0
votes
1answer
49 views

cron doesn't do anything

I tried making some crontabs, I created a file called brewupdater in my user folder, containing 0 */5 * * * ~/bin/brewupdate2. I then tried to run cron ~/brewupdater but it told me: cron: can't open ...
0
votes
1answer
20 views

Cleaning script with find and anacron

I want to automatically delete old files in ~/Downloads. with exception of ones that have '!' in their name. My current version is as follows: find /home/user/Downloads/ -mtime +90 ! -path '*!*' ...
8
votes
3answers
2k views

Run multiple cron jobs where one job takes a long time

I have the following general question regarding cron jobs. Suppose I have the following in my crontab: * 10 * * * * someScript.sh * 11 * * * * someScript2.sh 30 11 */2 * * someScript3.sh <-- ...
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 ...
0
votes
1answer
46 views

Cronjob not being executed

I'm trying to run rsync-books with a crontab. Typing crontab -e outputs: 55 12 * * * diegoaguilar /storage/bin/rsync-books Where /storage/bin/rsync-books looks like this: if [ -d ...
0
votes
2answers
2k views

Cron job to check if PHP script is running

I am having trouble regarding Cron jobs, I've basically got two PHP scripts that I want to keep running continuously on my server. Currently I am using an infinte loop to keep them going but they seem ...
1
vote
1answer
323 views

How to programmatically add new crontab file without replacing previous one

I am working on a small home automation project using raspberry pi (OS -Raspbian). I want to know how to add more than one crontab file using python-crontab module without replacing the previous ...
2
votes
3answers
175 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
727 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
42 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
351 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
43 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 ...
63
votes
8answers
138k 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?
5
votes
5answers
67k 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
146 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
630 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
806 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
61 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
24k 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
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? ...
0
votes
2answers
2k 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, ...
1
vote
1answer
636 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
614 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
44k 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
144 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
52 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
113 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
52 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
82 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
167 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 ...
43
votes
9answers
80k 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
24 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 ...