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

learn more… | top users | synonyms (1)

0
votes
2answers
36 views

Start daemon process from cron job

I have been trying for a few hours to do the following (on Centos 6): cron starts process A process A checks if process B is alive if process B is not alive, process A starts process B The ...
27
votes
2answers
8k views

How can I execute `date` inside of a cron tab job?

I want to create a log file for a cron script that has the current hour in the log file name. This is the command I tried to use: 0 * * * * echo hello >> ~/cron-logs/hourly/test`date "+%d"`.log ...
0
votes
0answers
14 views

Using cron to start a process on a terminal without using screen?

I want to start a process in a terminal using cron. I want the process to start in a terminal, so that I can continuously see the output of the process on the terminal, and kill it / restart it etc. I ...
-1
votes
1answer
21 views

Starting Debian mono application (that has a GUI) AFTER boot is done [duplicate]

I've been trying to figure out how to start an application after Debian (Wheezy) is done booting up and on an LXDE desktop session. It is a mono C# application. The script I have is simply mono ...
0
votes
1answer
23 views

Want to use find with rsync in script

I'm trying to make a script that will run in cron, that will search a path for specific file name. In the path there might be more folders with that same file name. If found and they are newer than 2 ...
1
vote
2answers
6k views

Run a script at startup

I am using Ubuntu 14.04. I wrote a small script named trial. The contents of the script are as follows: #!/bin/sh SHELL=/bin/sh PATH=/bin:/sbin:/usr/bin:/usr/sbin sh -c firefox I copied the ...
-1
votes
2answers
41 views

shell script not running using crontab

This is my script mboxutil -l > n.txt sed 's/^.*user//' n.txt > n1.txt cat n1.txt | sed 's/^.//' > n2.txt sed 's/\/.*//' n2.txt > dss_list.txt rm -f n.txt rm -f n1.txt rm -f n2.txt sed ...
13
votes
2answers
12k views

how can I make cron run a job right now, for testing/debugging? without changing the schedule!

I have a cron job that is scheduled to run everyday, other than changing the schedule, is there any other way to do a test run of the command right now to see if it works as intended?
-1
votes
0answers
22 views

Is it possible to use cron with a bash sh script that creates scripts via echo, which the main script then executes?

Is it possible to use cron with a bash sh script that creates scripts via echo, which the main script then executes? Cron appears to take over control of the outputs to be either the given email ...
0
votes
0answers
21 views

Unable to run perl script for ssh login to windows server (using Net::SSH::Perl) from crontab [on hold]

I have a Perl script which is doing remote login to the windows server via the Net::SSH::Perl module. If I run the script manually from my shell, it gives no error. Running from a crontab, however, ...
0
votes
1answer
41 views

Using nano to edit a crontab [closed]

I haven't been able to get crontab to execute any of my scripts on start-up. I want to know why it doesn't work. Below is an example of me trying to use it, and I've tried to provide as much ...
0
votes
2answers
38 views

Crontab Error: No Crontab For [user]

I'm seeing an error every time I do the command below. Why? $crontab -l no crontab for server Where server is the user account. This issue come about because the script in crontab doesn't work, so ...
1
vote
1answer
39 views

CasperJS and PHP In Cron Job Cannot Open Files, Works Fine When Run Manualy

I recently got a new DigitalOcean LEMP environment with Ubuntu. I tried making an SH script that uses CasperJS to scrape data from an external website to a JSON file, and a PHP script to parse the ...
0
votes
1answer
27 views

Is there a way to comment more than one entry at a time in cron?

I know the standard way to disable a task in cron is to comment the line with the task using the # sign in front of it, as with most Unix config files or shell scripts. e.g.: 53 23 * * * ...
0
votes
2answers
38 views

Where is my logfile of crontab?

no /var/log/cron ,no /var/log/cron.log on my debian7 ,Where is my logfile of crontab ? ls /var/log/cron* ls: cannot access /var/log/cron*: No such file or directory
-1
votes
0answers
35 views

crontab is not working correctly while script itself calling other script [closed]

My requirement is to monitor below network elements with certain periodic time Network Element Instance Num Current Req. Maximum Req. Status ARSLAB 0 0 ...
9
votes
2answers
4k 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?
1
vote
1answer
26 views

Unable to run the script in cron via manifest

I am trying to deploy a script to agents and run the script using cron every hour. When I am running puppet agent -t I am getting error: Error 400 on SERVER: Invalid parameter path on ...
2
votes
1answer
40 views

script running in crontab not giving output on shell screen

I am trying to run a simple echo script via crontab. I set that to run every minute, but it doesn't give output on shell screen. However, it runs fine when I run the script independently. Script ...
1
vote
1answer
14 views

Cron Job to Keep Daemon Running?

let us suppose I have a cron job like this: */15 * * * * /path/to/thedaemon The daemon (it being a python daemon via from daemon import runner) will not allow multiple instances of itself, which in ...
3
votes
1answer
47 views

Why doesn't cron run a test script from /etc/cron.hourly?

This is the first time I'm using cron through its /etc/cron.hourly directory to run a script once every hour. For some reason, the script doesn't seem to run. Here's what I did: Added a basic test ...
1
vote
3answers
28 views

Getting crontab events that would happen given a start date/time

Let's suppose we have a crontab scheduling some commands on an RPi project, and these commands toggle a status of a flag. The box could go out of power, and then reboot. I want to have the flag status ...
1
vote
2answers
27 views

Put two Cron jobs into crontab using wget

I am trying to put these two Cron Jobs: 0 3 * * * ! sudo -u asterisk /var/lib/asterisk/bin/module_admin --repos extended,standard,unsupported upgradeall 30 3 * * * ! sudo -u asterisk ...
40
votes
11answers
22k views

Correct locking in shell scripts?

Sometimes you have to make sure that only one instance of a shell script is running at the same time. For example a cron job which is executed via crond that does not provide locking on its own (e.g. ...
1
vote
1answer
18 views

How is this crontab interpreted “*/N * * * *” where N is between 31 and 59?

If I need to run jobs exactly every 50 minutes, example. 00:50 run 1 01:40 run 2 02:30 run 3 03:20 run 4 04:10 run 5 05:00 run 6 06:50 run 7 Will */50 * * * * cron work as expected?
2
votes
1answer
32 views

Difference between CRON tab 0/5 and */5?

The title says it all is there any difference between creating a CRON tab using 0/5 and */5? For example: 0/5 * * * * vs */5 * * * *
0
votes
1answer
18 views

Cron not working at startup, but works if restarted?

For some testing, I need to reboot my system every minute. I have a busybox based system, installed cron using opkg. I setup a cron job using crontab, everything looks ok: root@SL1000-1103DC:~# ...
2
votes
3answers
2k views

Stop cron sending mail for backup script?

I have set up a backup script to back up world data on my Minecraft server hourly using cron, but because the worlds being constantly edited by players, tar was telling me that files changed while ...
1
vote
2answers
46 views

about executing a python program in a shell script which is scheduled on crontab

i have a problem with regards on crontab. I have a script named checker.sh and i want to schedule it that would run every minute: * * * * * sh /home/pi/checker.sh so i have the script here: the ...
1
vote
0answers
25 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
1answer
28 views

Loading crontab from file at startup

I'm starting machines from an AMI (Amazon Machine Image) on AWS (Amazon Web Services) and want to load the crontab dynamically from a file instead of using the AMI's crontab. One approach I thought ...
0
votes
1answer
78 views

nginx logrotate error on cron job

I'm running Ubuntu 14.04 LTS and nginx on a Digital Ocean VPS and occasionally receive these emails about a failed cron job: Subject Cron test -x /usr/sbin/anacron || ( cd / && run-parts ...
3
votes
1answer
59 views

Regex for crontab validation

I need to check in bash whether an entry into the crontab file is valid. Is there a crontab command switch? I can extract individual lines and try to control individual items through regex. But I ...
1
vote
1answer
46 views

How to activate Virtualenv when a Python script starts?

I want to schedule a python script to run using cron on certain dates, the problem is that in order for example.py to work, example-env has to be activated, is there a way to make example.py activate ...
0
votes
3answers
50 views

Cron job not saving

I'm trying to write a very basic cron job but it doesn't seem to be saving. Here's what I've done: 1) crontab -e This opens up a file with vim. 2) #!usr/bin/env python 0 23 * * 0 ...
0
votes
1answer
27 views

tput: No value for $TERM and no -T specified

I am trying to run a bash script I have via cron, and I am getting the following error at the beginning of the execution: tput: No value for $TERM and no -T specified Here is what is in my crontab: ...
1
vote
1answer
27 views

Adding a crontab - syntax

crontab -l | { cat; echo "0 0 * * * /path/to/cron/job"; } | crontab - I took this line from the net, to add a new cron job. It works well and good. I got the doubts, 1) Why do we need the curly ...
1
vote
1answer
20 views

How to redirect tarsnapper output to /dev/null?

I use tarsnapper's make command for managing tarsnap backups like this: tarsnapper -c /usr/local/etc/tarsnapper.conf make Which works like it should and I get an output like this Creating backup ...
1
vote
1answer
2k 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 ...
2
votes
1answer
29 views

How to schedule shutdown every day?

We have a server that is used for Linux thin clients in a class. The server is started when required and I want to schedule it to power off at 22:00 every day to avoid power wasting. I thought of ...
0
votes
1answer
585 views

openSuse, not running the cron job

I have created a cron job in the /etc/cron.d/dispatchingEmail_I the permissions of dispatchingEmail_I are the following: -rw-r--r-- 1 root root 84 Sep 11 19:52 dispatchingEmail_I content of ...
0
votes
2answers
1k 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 ...
2
votes
1answer
55 views

Creating a cron job and watching its output in real time

When I look at the questions and answers on this forum, it seems like the threshold to ask a question is very high. At least for someone like me, with very little knowledge of Linux. Most of the ...
0
votes
1answer
52 views

what is the difference between cron and systemd ?

what is the difference between cron and systemd ? Why we can't use use only one of this two?
1
vote
2answers
155 views

How to set up cron job in Linux to delete all regular files?

I need to set up a job to delete all of the regular files in the /home/admin directory on the second day of every month at 8:30 A.M. It seems like wrong command: # crontab -e 30 08 02 * /bin/find ...
1
vote
2answers
12k views

running a script every 30 minutes with crontab using ROOT (Debian)

When I manually type: root@username:~# ./myscript.sh the script executes, however I tried the following combinations to have crontab execute myscript.sh every 30 minutes (forever) and none seem to ...
1
vote
1answer
45 views

Skip syslog/rsyslog logging of certain cron jobs

In most GNU/Linux distributions the default is to log start (and many different events) of every cron job to syslog. It's rather convenient, but not for a very frequent jobs, which started, say, every ...
1
vote
2answers
40 views

CRON Job To Execute Command On Low Memory

I have a situation where I may need to execute an SAP command line tool hdbsql when memory gets too low (to help clean out the HANA table cache). I'm not well versed in Unix/Linux, and was wondering ...
2
votes
1answer
153 views

Task not run by crontab

crontab strangely does not execute my script, although the script is running just fine from the shell terminal. I already made sure that scripts are separated from each other by a new line space. ...
0
votes
1answer
34 views

Running a ruby cron job

I was trying to create a cron job which runs a ruby code on digital ocean, however it seems I'm making a mistake. It doesn't give any error but it doesn't also do anything. I ran this cronjob on my ...