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

learn more… | top users | synonyms (1)

0
votes
1answer
13 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
19 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 ...
1
vote
3answers
58 views

When will this cron run

Cron: * */6 * * * /path/to/command I want this cron to run once in every 6 hour. Whats wrong with the above cron definition, and why?
0
votes
0answers
18 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
30 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 ...
-3
votes
0answers
33 views

To change the output file name of the cron

I am using below cron to generate the logfile with name syntax as "AS_XYZMSCa_VLR DUMP_20150213" I wanted the output file with name syntax as "AS_MSCa_VLR DUMP_20150213" X,Y,Z,a - variables #! ...
0
votes
1answer
30 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
37 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 ...
1
vote
2answers
28 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 . ...
0
votes
0answers
8 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 ...
-2
votes
2answers
37 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 ...
-2
votes
3answers
41 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` >> ...
1
vote
1answer
20 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: ...
0
votes
1answer
51 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 * * * * ...
2
votes
1answer
106 views

Cron can't access my home directory when I'm logged out

I have quite a strange problem using cron. I distilled it thus far: I created following simple bash script in /home/user1/cron_dir/cron.sh: #!/bin/bash echo "Success" As user1 I created following ...
2
votes
2answers
62 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
37 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
38 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
2answers
598 views

Use /etc/aliases for outgoing mail relayed by postfix with local domain

I'm using Ubuntu 12.04 with postfix configured as satellite system that relays outgoing mail to Gmail. For sake of example, my registered domain is example.com I want root cronjobs' error output to be ...
2
votes
1answer
41 views

Remove tar compress spool from cron email

I have a crontab job that call a simple script to backup a website: 15 0 1,10,20 * * /home/username/bin/backup_whatever This is the script: #!/bin/bash TODAY=$(date +"%Y%m%d") ...
1
vote
3answers
119 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 ...
3
votes
1answer
43 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
150 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 ...
7
votes
1answer
2k views

Recover cron jobs accidently removed with crontab -r

I entered crontab -r instead of crontab -e and all my cron jobs have been removed. What is the best way (or is there one) to recover those jobs?
0
votes
1answer
39 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
48 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
41 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 ...
1
vote
2answers
99 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
67 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
30 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 ...
2
votes
2answers
3k views

cronjob for automatic DB backup to date prefixed file

I am using the latest Linux Mint. I was wondering if it's possible to create a special cronjob for a database backup. In my /etc/cronjob file I have the following code: # Minute Hour Day of ...
1
vote
1answer
20 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 ...
2
votes
2answers
46 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 ...
3
votes
2answers
163 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 ...
0
votes
0answers
36 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
51 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
4answers
21k views

crontab -e , then 0 * * * * = every hour; then xclock

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 ? ...
1
vote
3answers
67 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 ...
0
votes
2answers
2k views

how to set crontab PATH variable

I had a problem running a script from crontab. After some research I understood the problem was because PATH parameter doesn't include /sbin. I looked what it does include in /etc/crontab: ...
0
votes
1answer
43 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
1answer
711 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 ...
0
votes
1answer
424 views

how to automatically cleanup failed PHP uploads in /tmp?

How can I automatically cleanup failed uploads? PHP is storing them in /tmp and all file names look like phpAbCDeF (basically php followed by 6 characters). I know that I can use the command: find ...
0
votes
2answers
29 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
49 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
37 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
63 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 > ...
0
votes
2answers
37 views

Turn off mail notification in terminal

I'm running some cron jobs on my machine and every time I fire up a terminal session I'm getting a 'You have mail' message (the job produces output on success which gets mailed to me). Any way to ...
0
votes
2answers
41 views

Cron Job Not Running

Oracle Linux 5.10 I can manually run the script "tblspc_usage.sh" successfully as the oracle user. I know this because it emails me a report. But it not run at all from cron. It doesn't generate a ...