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

learn more… | top users | synonyms (1)

1
vote
2answers
49 views

Do I need to keep an SSH session alive for cron to run?

I know about nohup. It prevents processes from dying after a hang-up. What I want is my user crontabs to run even if my session has timed out when they are supposed to run. I believe I need the user ...
0
votes
2answers
31 views

Auto Delete Inactive files after x

Is there a way I could delete certain folders after x amount of days of inactivity? I was thinking of using cron but that wouldn't take the inactivity part into consideration. Is there any Debian ...
3
votes
2answers
212 views

Location of the crontab file

as many (most?) others, I edit my crontab via crontab -e, where I keep all routine operations such as incremental backup, ntpdate, various rsync operations, as well as making my desktop background ...
5
votes
4answers
230 views

Change the time zone of a cronjob

I have a cronjob which is executes every day at 9:00 AM of UTC-Time. I'm in GMT+1 so it executes at 10:00 AM local time. When there is the timezone change (to daylight saving time, DST), the cronjob ...
-4
votes
0answers
27 views

backup script to copy files in multiple di

Below script will list keyword from check.conf and search for those keyword in app dir. If match keyword file is found then it copies that file from App to /Data10 location. I have multiple dir's, ...
0
votes
2answers
23 views

Crontab to back up directory

So I have this in my crontab -e 0 0 * * * /opt/www/backup.sh And in the file, I have the following: #!/bin/bash FILENAME=$(date +%Y%m%d).tar.gz tar zcf backups/$FILENAME f The file is located at ...
-1
votes
1answer
34 views

Cron job * is replaced by file name in current directory [duplicate]

This is my first shell script program, so i think this is more likely a silly question for you all. Overview of problem My need is to write a shell command for installing our Node.js server. ...
0
votes
4answers
76 views

cron - production-ready alternative

I am testing out a Raspberry Pi with the aim to use it in a production system for logging manufacturing data. All is working well and I have been recording test data over the last month. For ...
0
votes
0answers
35 views

shell calling another shell program fails when run by crontab

I have scheduled to run the run.sh program like this: 16 09 07 * * root /opt/db_maintain/run.sh > /opt/db_maintain/temp-log and here is the run.sh: #/bin/bash #********* Saman ********* ...
3
votes
2answers
118 views

How do I format these two complex cron statements?

I need two very specific cron statements: A cron entry that would run on the 2nd Monday of each month every 4 hours beginning at 02:00 and execute the file /opt/bin/cleanup.sh A cron entry that ...
-1
votes
0answers
11 views

Outside IP curl cron on FreeBSD

I have FreeBSD 10.1 (ssmtp,curl) I want to receive outside IP from cron. */10 * * * * root curl http://ifconfig.me/ip | mail my@mail But I got the following response Null message body; hope that's ...
0
votes
1answer
34 views

How to set path in cronscript

I am running a cronscript like: */45 * * * * /path/to/php /path/to/file.php it creates a file and put on home directory; But I want to create this file in my desired path like: */45 * * * * ...
0
votes
0answers
19 views

Synology jailkit debian cron debootstrap

I have a Synology NAS. For advanced using of my server, I installed a debian with chroot-jailkit and debootstrap. I follow those instructions (in french sorry) This is working really fine. I have ...
0
votes
0answers
37 views

How do I realize a Shell Script that keeps track of how long the keyboard has not been used ?

Is it possible to write a script that counts the time between two pressed keys, so that one could put a script into the crontab that checks if the keyboard had not been for longer than a certain time ...
2
votes
4answers
87 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
3answers
59 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
59 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
35 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
46 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 ...
2
votes
1answer
57 views

Cron job not running after giving command in crontab

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
37 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
145 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
70 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
79 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
32 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
3answers
216 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
31 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
38 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
56 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 ...
1
vote
1answer
88 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
47 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
14 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
44 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
69 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
57 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
24 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
77 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
74 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
58 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
57 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
651 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
168 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
70 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
90 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
82 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
174 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
41 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 ...