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

learn more… | top users | synonyms (1)

2
votes
4answers
77 views

Calling scripts from inside other scripts

I have a script which I call every 10 minutes with a cronjob: */10 * * * * ~/mydirectory/myscript.sh Now, inside ~/mydirectory there is also another script, let's say myotherscript.sh which I'd ...
0
votes
0answers
8 views

How to setup rsyslog to get unsuccessful cron logs only [on hold]

Please suggest me How to setup rsyslog to get unsuccessful cron logs only on centos 6 Thanks
0
votes
3answers
51 views

crontab is launching multiple java process every 5 minutes?

I have a java runnable jar which I need to run it if it not running or got killed for some reason so I decided to use crontab for this - I need to run the crontab as "poppetapp" user so I am logged ...
0
votes
1answer
41 views

systemd timer every X days at 04:00

I have been reading on OnCalendar= Sadly, I found no info on how to schedule an event on a day other way than defining a day of the week, which would make it run every week at the rarest. I need ...
1
vote
1answer
31 views

cron and at send mail to wrong user

I have cron and sometimes at on an ubuntu 14.04. jobs output should be mail to me, but failed. I make a .forward in my home dir. mail explicitly send to local unix user is forwarded to my corp mail ...
-1
votes
1answer
38 views

cron/ bash is not working via scripting, scoping issue?

I'm trying to schedule a task to run ever minute using cron: * * * * * /home/yzm/simple.sh >> /var/log/cron.log and this returns: bash: yzm: command not found cd-ing out of that folder: cd ...
0
votes
1answer
41 views

cron job not running after giving command in cron tab

I am trying to run a cron job in linux with following command crontab -e typing the following details and saving it MAILTO="mail@domain.com" 00 01 * * * /usr/local/bin/php /var/www/html/cron.php ...
1
vote
2answers
35 views

Cron job gives no output

I tried to schedule my first cron job as follows: crontab -e The file had some comments at the top, and on the first line after those, I put * * * * * date I expected the date and time to be ...
1
vote
4answers
140 views

crontab not launching one script

I have issue with my crontab - cron is not launching one of my scripts this is top part of my crontab (root) SHELL=/bin/bash #--------------------------------------- # Items availability ...
1
vote
1answer
61 views

Run shell script from crontab after server stop/start/restart

I want to schedule a shell script in crontab that runs whenever server restarts. It should also run when someone starts the server after it stops abruptly or crashes. How to do so in crontab? Any ...
1
vote
0answers
70 views

'nc' using ~100% CPU when transferring a FIFO file

On the server which is always connected I’m using this in a crontab: @reboot nc -k -l 1337 < /tmp/fifo.fifo On the client which is not always on the network or switched on I’m using this ...
1
vote
1answer
27 views

how to temporarily disable a user's cronjobs?

How do I temporarily disable one or more users' cron jobs? In particular, I do not want to suspend the user's cron rights - merely not fire any of their jobs. I am on SLES 11 SP2 and SP3 systems
4
votes
2answers
119 views

Running a script during booting/startup; init.d vs cron @reboot

I am currently trying to understand the difference between init.d and cron @reboot for running a script at startup/booting of the system. The use of @reboot (this method was mentioned in this forum ...
0
votes
1answer
29 views

Having problem with mysql dbdump when password starts with special character

I am trying to take a db backup with a php file that is running from a cronjob. It was running fine when I tested with sample db. But when I used the actual db there was an error. I am using ...
0
votes
1answer
22 views

cron: output of a script?

I've got a cronjob that looks like this 0 0 * * 7 [ $(date +\%d) -le 07 ] && /home/archiver/archiver.sh &> /home/archiver/output And it works from the cron+bash perspective in that ...
0
votes
0answers
34 views

Using a custom script for cron jobs mail notification

After coming across Mailgun I would like to write my own script to use their API in order to send mail notifications from cron jobs — avoiding in this manner having to worry about installing a ...
0
votes
1answer
44 views

Add cron job via single command [duplicate]

First of all, I'm using elementary OS (based on Ubuntu 12.04). I have a cron job set up to run a script every day at 23:30: 30 23 * * * /path_to_script/ Is there a way to add it to cron via a ...
0
votes
1answer
56 views

User cannot access crontab

Oracle Linux 5.10 Root user can access crontrab, but not any other user. There is no /etc/cron.allow and the /etc/cron.deny is an empty file. Using Oracle user account: [oracle@dub-ImrORA2 ~]$ ...
1
vote
1answer
46 views

Why scripts run as user but not as a cron?

I have a script that checks to see if port 4000 is open and listening, if it is return true, else start a service that also outputs a logfile. The script runs fine if I execute it as a user, but if I ...
0
votes
0answers
13 views

Pngquant does not run in Crontab

I have created a small script to compress all the images using pngquant. The script is as follows: #!/bin/bash find /home/ghosthut/wp-content/uploads -mtime -2 -iname '*.png' -print0 | xargs -0 ...
1
vote
2answers
41 views

I would like to delete entire archive log except retain last generated archive log

I want to delete all the archivelog, But retain last generated archive log alone. Currently I am using following which will delete entire/all the archive log and clear the directory itself. find . ...
-2
votes
2answers
54 views

Not able to run shell script using cron [closed]

I have a shell script test.sh in /home/username The test.sh file contains the following lines - #!/bin/sh cd /home/username/bin sh launch.sh ParameterName #launch.sh is in /home/username/bin ...
0
votes
1answer
55 views

Cronjob schedule

I have a task which I wanted it to run on every hour 56 minutes not sure which I should do below and what does "*/number" means. An example :- 12:56PM, 01:56PM, 02:56PM ... Use this ? */56 * * * * ...
1
vote
1answer
22 views

Why does apt-get remove leave package-installed cron files lying around?

Is there a good reason why apt-get remove leaves installed cron files in place where an apt-get purge or apt-get remove --purge is actually required to completely remove them? Example files may be: ...
-2
votes
3answers
64 views

CronTab is not working in Ubuntu for image compression job [duplicate]

I am trying to set up a cronjob to execute the following script. The function of the script is to find and compress png and jpg files in a WordPress directory. #!/bin/bash echo `date` >> ...
2
votes
2answers
68 views

Why is cron ignoring a / (forward slash) interval?

I want to set up a job to run every 15 minutes, starting at the 5th minute. This is my crontab line: 5/15 * * * * /root/job.sh >> /root/job.log But it only runs once an hour, on the fifth ...
0
votes
1answer
28 views

Is there any way to maintain counts in crontab?

Need to keep a track of the succeded jobs, on daily basis, with jobs ranging from /10 /20 minutes to twice/thrice a day, least for these every 10/20 minutes runs, I'd be interested to know if there ...
1
vote
0answers
38 views

What does CRON=1 do?

What does setting CRON=1 do when set in front of a command? CRON=1 ./foobar.sh I suspect that the cron environment variable does something for printing to standard out. But I can't find anything ...
2
votes
0answers
49 views

Display cron job times in a human-friendly format

Is there a way to display or is there a tool that can parse a crontab expression and display it in a human-friendly way? 10 6 * * * sh /usr/local/crons/file_check.sh For example, for the above cron ...
3
votes
1answer
49 views

How can I run Cron job every 5 days

I have 5 shell scripts, I want to run them in 5 days cycle, like follows: Day 1 : script 1 Day 2 : script 2 Day 3 : script 3 Day 4 : script 4 Day 5 : script 5 Day 6 : script 1 ...
1
vote
0answers
394 views

mail: cannot send message: process exited with a non-zero status

I've had a cronjob working for about a fortnight without any problems. Then last night I checked I didn't get the email that I usually get. I went to the terminal to try send myself an email, I got ...
1
vote
3answers
151 views

BashScript works from Terminal but not from CronTab

I've got a bunch of CronJobs, and they work fine, except for one. I've looked through a lot of forums and websites, and tried a combination of things but alas nothing has worked. Rephrasing the ...
0
votes
1answer
54 views

cronjob bash script called within another shell script not working

I have a shell script which calls a bash script within it. when I run this shell script manually it works fine however when I schedule this thru cronjob, the bash script is not doing the intended job. ...
0
votes
1answer
71 views

auto restart apache when high load average

My server always shut down when it reach a high load average. I have optimized my apache, mysql. but i cannot prevent sometime in a heavy traffic. So I try to write some shell to control load average. ...
0
votes
1answer
54 views

Entries in /etc/crontab not getting called in Centos 6.x

I created a dummy entry in /etc/crontab, but it doesn't get executed according to the cron log: /var/log/cron: Feb 7 08:20:01 localhost CROND[22781]: (root) CMD (/usr/lib64/sa/sa1 1 1) Feb 7 ...
0
votes
1answer
96 views

command to clean up old log files

I was trying to automate some auto cleaning of my Ubuntu System, with Cron Jobs I tryed to simplify this: sudo find /var/log -type f -name "*.1.gz" -delete sudo find /var/log -type f -name "*.2.gz" ...
0
votes
1answer
36 views

What does `line 19: 12364 Killed` mean in crontab error message?

I got a daily crontab task: 50 1 * * * sh /my_path/daily_task.sh > /tmp/zen_log 2>&1 This daily_task shell script will run some python scripts and produce a data file. And it fails for ...
1
vote
1answer
25 views

Prevent empty rsync email on cron

I have a crontab job to sync a folder: 50 5 * * * /home/user/bin/sync-folder This will execute an script: #!/bin/bash sudo rsync -rav --delete --log-file=/tmp/rsync-output /origin /destination ...
3
votes
2answers
183 views

Run crontab only if condition

I have a bash script that emails me whenever a web server is not responding, and the script is ran by cron every 5 minutes. However, if the website goes down for a few hours, I'd receive too many ...
2
votes
2answers
48 views

Find and rm command not obeying exclude list occassionally

I am running a find and rm -rf directory list modified earlier than 7 days with an exclusion list of directories which should not be deleted at any case. This is the script excerpt find ...
0
votes
0answers
56 views

Issue with a script launching URL, then pkill firefox after X seconds with cron job

I am trying to create a shell script that will start firefox on a certain URL, then kill it 120s later. I have a script that mostly works and a bad crontab job that doesnt seem to. testscript.sh: ...
1
vote
1answer
55 views

Crontab only for 24 hours, but every 4 hours

How can I run a crontab for every 4 hours where I download a file from a certain given link but only for 24 hours, starting at midnight? And put the 8 file content in a new file?
1
vote
3answers
82 views

Cronjob doesn't execute shell script, but when I am executing it standalone it works. Why?

Shell Type: >echo $SHELL /bin/ksh Cronjob : 15 * * * * /bin/ksh /wls_domains/resMGT/logs/bea/wlr3queuetransaction.sh > /wls_domains/resMGT/logs/bea/data/script.log The script is as below: ...
1
vote
1answer
29 views

Is there a good reason to prevent users from using cron/at?

At work on our linux servers, I have a standard non root account. Unfortunately the account does not have permissions to crontab or at. Is there a good reason to block these commands? I can write a ...
1
vote
2answers
124 views

Restarting OpenVPN on SELinux by a cronjob

I have a server with some OpenVPN instances (one server, several clients) running on Debian with enforcing SELinux. The connections to some of the VPN servers my machine is connecting to are somewhat ...
0
votes
1answer
64 views

Crontabbed shell script not able to create/write to a file

I have written a simple shell script to backup the tables in my DB using the mysqldump command. The command simply dumps the DB into a dbName.sql file. However, if the dbName.sql file doesn't already ...
0
votes
2answers
36 views

How to automaticly open a URL at specific times each day

I am using kubuntu 14.04. I have installed cron using sudo apt-get install cron, and then I created this file in IDLE, called openurl.py. #!/usr/bin/env python import webbrowser ...
1
vote
0answers
75 views

init.d script ignored in yocto based distro

I'm modifying an embedded distro that is built using the yocto project. I need to add cron to it and have the cron daemon start on startup. I have created the symlink /etc/rc5.d/S98cronstart that ...
2
votes
1answer
45 views

Time remaining for the next run

I need to calculate the time remaining for the next run of a specific job in my Cron Schedule, I've a Cron with jobs having frequencies of per hour, thrice a day etc, no jobs running on specific ...
1
vote
2answers
84 views

Databases backup with cron

I'm trying to set up a cron job in order to backup my databases daily. Here's what I wrote in my crontab file : 25 18 * * * root mysqldump -u root -p myPassWord --all-databases | gzip > ...