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

learn more… | top users | synonyms (1)

1
vote
1answer
71 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 ./....
0
votes
1answer
67 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
170 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 ...
1
vote
0answers
156 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 ...
0
votes
1answer
54 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
1answer
55 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
104 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
63 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
21 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 '*!*' -...
9
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 <-- ...
0
votes
1answer
47 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 "/media/Beagle/...
1
vote
1answer
421 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 ...
0
votes
2answers
1k 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
55 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
531 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
46 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 php=/usr/bin/...
2
votes
3answers
188 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
1answer
182 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
693 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
63 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
206 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
132 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
54 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
89 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
262 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
428 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
3k 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
255 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
851 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
44 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
64 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
81 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
57 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
176 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
130 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
77 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
33 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
250 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
328 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
181 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
202 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
61 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 ...