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

learn more… | top users | synonyms (1)

1
vote
2answers
537 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
38 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
242 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
252 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 ...
0
votes
2answers
29 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
38 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
101 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
43 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
127 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 ...
4
votes
4answers
1k views

Is setting a higher nice level for a process an effective way to reduce its impact on system load/CPU time?

I have an rsync cron job which is pushing the server load and triggering monitor alerts. If I set the job to be run with a high nice level, would that effectively reduce the impact it has on system ...
2
votes
1answer
544 views

How to respawn vpnc when it stops?

As root, I've setup a crontab rule that launches vpnc everyday early in the morning (before I arrive at my workplace). But it often occurs that the vpn stopped mid day. As a result, I have to sudo ...
0
votes
1answer
38 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
48 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 ...
1
vote
1answer
318 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 ~]$ ...
0
votes
0answers
39 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
122 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 ...
9
votes
3answers
3k views

Using notify-send with cron

I am using Arch Linux with KDE/Awesome WM. I am trying to get notify-send to work with cron. I have tried setting DISPLAY/XAUTHORITY variables, and running notify-send with "sudo -u", all without ...
0
votes
3answers
96 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 ...
1
vote
4answers
176 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 ...
19
votes
2answers
86k views

How can get a list of all scheduled cron jobs on my machine?

My sysadmin has set up a bunch of cron jobs on my machine. I'd like to know exactly what is scheduled for what time. How can I get that list?
0
votes
1answer
84 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
votes
1answer
54 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 ...
1
vote
1answer
51 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
vote
2answers
41 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
2answers
200 views

How to restart my java program automatically if it gets killed?

I am running my runnable jar in linux machine (machineA) as shown below. In the runnable Jar, I have a java program which sends email to me every 15 mniutes. ...
3
votes
3answers
225 views

Detecting cron tasks run by another user

I am currently working through the Nebula challenges on exploit-exercises.com, and one of the challenges relies on a script being run by cron. This is run by another user (flag03) and the user I am ...
1
vote
1answer
81 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
4answers
26k 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 ? ...
1
vote
0answers
95 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
50 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
0
votes
1answer
39 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
23 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
47 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
67 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
57 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
55 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
17 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
98 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
103 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
25 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
61 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
167 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
82 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
41 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 ...
3
votes
0answers
83 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 ...
2
votes
1answer
59 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
261 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
74 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 ...