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

learn more… | top users | synonyms (1)

2
votes
0answers
71 views

use find command in bash file

I am using this script in my Linux machine to find all files that were modified yesterday: #!/bin/bash find /home/*/domains/*/public_html/ -name "*.php" -mtime -1 | while read line; do echo "$line" ...
2
votes
0answers
158 views

running cron on a chroot

For my web development I use a debootstrap'ped Debian with sysvinit, I start apache2/mysql manually only when I need to work. Now for a new project I require to run some scheduled task for which I ...
2
votes
0answers
45 views

Why a crond can start late randomly

I have this issue of a cron that executes a PHP script at minute 20 every hour, This script generates a small number of reports based on data from a MySql database. Generally this script ends ...
2
votes
0answers
210 views

How to overcome this error when running a script in crontab?

This is basically my script. #!/bin/sh #set -x PATH=/usr/jdk/instances/current/bin:/usr/bin:/bin:/opt/ss7/access/bin:/opt/ss7/sgc/bin:/opt/ss7/access/install:/opt/ss7/sgc/install:/usr/jdk/instances/...
2
votes
0answers
41 views

How do I process new additions to logs

I know that I can use a few tools like tail and less to view the newest additions to a growing log file. What I want to do, though, is run some sort of script at regular intervals (like cron) on the ...
2
votes
0answers
78 views

Strange cron behaviour

I have a script that reads a list of IPs from a file, compares with the existing ones in a chain, and adds recently added IPs in the file into that chain. Running the script manually (e.g., ./script) ...
2
votes
0answers
178 views

Configure job to expire

I'm learning Linux at the moment and were doing some exercises scheduling jobs with cron and crontab, but I'm wondering if it's possible to limit the amount of times that the scheduled job is ran. ...
2
votes
0answers
1k views

`crontab -e` sometimes fails with “Creation of temporary crontab file failed”

From time to time crontab -e fails on me on a Ubuntu box. It is the same for all users including the root and crontab -eu <user> under the root. Goes like this on a regular basis, a success here ...
2
votes
0answers
246 views

Use dedicated per-user log file for cron and?

On Ubuntu 12.04 how can I configure cron to log to a particular file when it runs jobs as a particular user? I am interested in redirecting both the messages that go into auth.log and those going into ...
2
votes
0answers
1k views

Cron file syntax checker/validator script

Does anyone know a script (bash, perl, php ...) to validate the syntax of crontab files? I found this http://www.intuitive.com/wicked/showscript.cgi?053-verifycron.sh but just Vixie cron notation is ...
1
vote
0answers
33 views

mutt doesn't run as a cron job wrapped in a bash script

mutt runs correctly like this: $ cat /home/user/test this is a test $ mutt -s "test" to@destination.org </home/user/test If I put this inside a bash script (stored in tmp1): #!/bin/bash /usr/...
1
vote
0answers
22 views

Minecraft acting differently when started from terminal compared to started by cron job at start-up

So I use a CentOS Linux 7.2.1511 server, where I host a couple of things, amongst them a Minecraft server. Since from time to time server is rebooted I scheduled a cron job to run minecraft server on ...
1
vote
0answers
71 views

Managing cron jobs across multiple servers

We are facing a problem with managing cron jobs over multiple servers with dependencies. I hope there is an opensource central management project that I can be used to handle that and report the ...
1
vote
0answers
44 views

Program/script to limit cronjob output

Short version: Is there an off-the-shelf program to avoid being pinged repeatedly be frequent cron jobs in periods when they fail? I have a custom implementation but it seems like something someone ...
1
vote
0answers
86 views

Linux password expiring and cron jobs failing

I have jobs running on a server which I access via powerbroker (so don't know the password). However the password of the user account expired recently and the said jobs failed. Due to password ...
1
vote
0answers
58 views

Crontab -e @reboot script doesn't start on restart

I add a string to crontab -e @reboot /home/user/start-ethminer.sh > /home/user/start-ethminer.log 2>&1 My /home/user/start-ethminer.sh file has the following content: #!/bin/sh screen -m ...
1
vote
0answers
155 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 ...
1
vote
0answers
45 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/...
1
vote
0answers
43 views

How to override email address used by at command

cron has MAILTO setting to explicitly configure the email address that will receive the report Does at have anything of the kind? Man page says it will send using /usr/sbin/sendmail but which ...
1
vote
0answers
54 views

Send email on every change of service status

I am running a Debian server and i have setup mailutils to send an email from command line from root@localhost to an external email. I would like to slightly modify it, so it can send emails on every ...
1
vote
0answers
183 views

Schedule backup with notification?

To avoid editing files at the same time of backup scheduled by cron, I figure out a way: Before backup, send a desktop notification such as notify-send -t 0 "Ready for backup", to let me prepare (...
1
vote
0answers
201 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 command:...
1
vote
0answers
122 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 ...
1
vote
0answers
321 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 ...
1
vote
0answers
98 views

Cron job running at 12.00 AM despite changing its time

I have only one cron configured in cPanel for WHMCS to run once per day at 12.00 AM. The cron sends daily activity logs to my email. A problem came up recently in which cron job activity logs sent ...
1
vote
0answers
59 views

Can I change the exclude file list while running rsync under a cron job

I am using Fedora 20, MATE desktop, zshell. I have started a cronjob to run, every evening, an incremental backup using rsync, closely following the suggestions here. After the first run yesterday, ...
1
vote
0answers
104 views

Logrotate or scripting to manipulate log file

I want to make sure that a certain log file gets empty when it reaches a specific size. I first used logrotate since the man page says: It will not modify a log multiple times in one day unless ...
1
vote
0answers
192 views

How to monitor the integrity of a script that is running?

I want to make sure a running python script was not modified accidentally by some other process (or cosmic ray, or unexpected developer update). I've heard of comparing a checksum of the script (e.g. ...
1
vote
0answers
98 views

How to set one job to run at precise time with anacron without losing config at next upgrade?

I want logrotate to run at a precise time daily. Currently it is set to run at some random time using anacron and I don't want to change the randomness factor for all the other jobs. I have ...
1
vote
0answers
41 views

start xscreensaver from cron@reboot, ubuntu startup, service/deamon?

I need start xscreensaver for ubuntu, and it can be started in ubuntu startup application. my question is: can xscreensaver be started in cron@reboot? can xscreensaver be started in service/deamon? ...
1
vote
0answers
480 views

Cron job scheduled to run on specific day-of-week is running on last day of month as well

I have a cron job scheduled to run every Thursday at 6am via the following schedule: 0 6 * * 4 It's been running as expected, but on Tues, September 30th it ran (unexpectedly) and again on Thursday,...
1
vote
0answers
175 views

Maintain screen session when executing shell script on boot

Solved: I solved this problem by introducing a delay before executing the script: @reboot sleep 60; /root/start_server.sh On Ubuntu 14.04, I have a crontab entry set to run on reboot: @reboot /...
1
vote
0answers
657 views

systemctl to start cron-like job

In /etc/systemd/system directory I have: rsnapshot-backup.service file, with following content: [Unit] Description=rsnapshot backup automation [cron like] [Service] Nice=19 IOSchedulingClass=2 ...
1
vote
0answers
34 views

How to block the user for a certain amount of time

Suppose, I am working in X environment, and I want to have an obligatory periodic rest. Is it possible to setup a root cron job, that will block my user for 5 minutes every 45 minutes? I am using ...
1
vote
0answers
5k views

why daily cron isn't running on CentOS 6?

I have a daily cronjob set up on CentOS 6 OS which should look after the log rotation job. The file is /etc/cron.daily/logrotate and it's contents are #!/bin/sh /usr/sbin/logrotate /etc/logrotate....
1
vote
0answers
5k views

Trying to kill cron job processes found by “ps ax | grep keyword” logged in as pi user

I'm trying to kill several processes from the command line logged into the pi as the user pi. All of the processes have been started by cronjobs, so they should belong to the root user. I'm running ...
1
vote
0answers
120 views

Create a fake read only device like file with incrond

I need to generate UUID with uuidgen (not through any function call, but external command, because processes which will read the file cannot call any APIs or external commands directly). My idea is ...
1
vote
0answers
58 views

Unplug AC causes anacron to stop. No resumumption if cron.daily had already started?

Anacron is started/stopped by a number of means, one of which is when AC power is plugged/unplugged, as can be seen by examining /etc/apm/event.d/anacron and /usr/lib/pm-utils/power.d/anacron. You can ...
1
vote
0answers
2k views

wget command not working in cronjob

here is my command : wget -c -O /home/alireza/Desktop/1.mkv http://mysite.com/myfile and here is my /etc/crontab file : SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ 0 2 ...
1
vote
0answers
133 views

Scheduling cronjobs at specified time

I have scheduled some jobs in crontab which are to be run one by one, at some specific time. My script for crontab is : 15 10 * * * /Users/sri/files/BatchFF.sh 45 11 * * * /Users/sri/files/BatchGC.sh ...
1
vote
0answers
168 views

External HDD read/write permission changing from a cron job

So, I run an overnight python script that runs a backup of our web data in the /var/www directory, then moves the backups to an external HDD in /media. The script in scheduled in the sudo crontab ...
0
votes
0answers
24 views

Crontab and python script

On raspian I created a crontab file using the following command: sudo crontab -e Added the following lines to cron @reboot sudo /etc/init.d/cron start 0 * * * * sudo /usr/bin/python3 /home/pi/dev/...
0
votes
0answers
9 views

What am doing wrong with this systemd/Timers setup?

I want "bot.sh" to be executed every 15 minutes. What am I doing wrong? /etc/systemd/system/redditbot.service [Unit] Description=reddit bot anti_anti_adblock [Service] Type=simple ExecStart=/home/...
0
votes
0answers
32 views

Godaddy Cron timezone change

There is a discussion http://stackoverflow.com/questions/13289751/cron-job-in-a-different-timezone/37764183#37764183 Could anybody clarify answer of @Bartosz Kowalczyk http://stackoverflow.com/a/...
0
votes
0answers
22 views

Settings of Poller Interval and Cron Interval on cacti

Latest version running of Cacti on linux machine and I am bit confused with Poller Type, Poller Interval and Cron Interval. The current setup is set to monitor ping latency, linux machine and dns ...
0
votes
0answers
43 views

Default crontab that executes cron.(hourly|daily|weekly|monthly)

I have to build a crontab that will execute (with run-parts) any script located in the standard /etc/cron.(hourly|daily|weekly|monthly) folders. I have never done this before. Does this look correct?...
0
votes
0answers
24 views

cron job quit working after latest apt-get upgrade

I've been running a cron job every 15 minutes for years, with few problems. Sometime in the last week, it quit running, I'm assuming after a apt-get upgrade && apt-get dist-upgrade. I was ...
0
votes
0answers
45 views

netcat output does not write to array if launched from cron

I am able to run this script as a user or root with bash or sh. Doing so gives me the output that I expect (arrayFWS is written to file, then emailed). However, when I run it with crontab with user or ...
0
votes
0answers
22 views

How to make cron job which suspends computer before specified time of the day

I am trying to make script which suspends computer if it is used before specified time of the day or if it is used too long. #! /bin/bash PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/...
0
votes
0answers
43 views

Junk Material on root crontab

I am investigating unexpected restart issue on my Oracle Unbreakable 6.5 and found some unexpected results on crontab for root users. I know that these are junk entries that my be cause to reboot ...