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

learn more… | top users | synonyms (1)

0
votes
1answer
6 views

how to close epiphany through a script with cron?

I have been making scripts to open and close a speficic website, with a cronjob, on the raspberry Pi. The opening script works perfectly. It is as follows: #!/bin/bash export DISPLAY=:0 && ...
2
votes
0answers
71 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. ...
4
votes
2answers
392 views

Mysterious “unable to resolve host” in dead.letter

In the ~ directory of the root user on my debian wheezy server regularly appears file named dead.letter with (currently) the following content: orion : Jul 25 10:17:31 : root : unable to resolve host ...
-1
votes
2answers
88 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 ...
15
votes
3answers
15k views

Does RHEL/CentOS execute all cronjob files under /etc/cron.d/*, or just some of them?

This is a Red Hat Enterprise Linux 5 system (RHEL). We manage this system using CFengine. We have several cronjobs which are running twice as often as usual. I checked the cronjobs under /etc/cron.d/ ...
2
votes
1answer
42 views

Hourly cronjob does not work

So just to sketch the outlines of this problem, i made an cronjob that should be executed on each full hour like this: 0:00, 1:00, 2:00. In all the manuals/tutorials i found on the internet they say ...
1
vote
2answers
84 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 ...
2
votes
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 ...
0
votes
1answer
45 views

How to do cron time reset? [closed]

I have a Raspberry Pi that run many cronjob. I wonder if I do as below command, will the cron time reset or it will resume the time lapse? If it doesn't reset, how can I reset the time lapse on cron ...
0
votes
2answers
27 views

Not all shell scripts working with crontab

I know this is a pretty broad title but I didn't know what to start with. Anyway, straight to the point. I have a little VPS I run apache and a Minecraft server on. I don't ever turn it off, but ...
1
vote
2answers
77 views

How do I scp a file from server A to server B from cron?

I have a file in server A which I am able to do transfer to server B using scp. I need to do this through a cron entry. server B has a password. How do I perform this?
-2
votes
0answers
16 views

Red Hat Linux Cron Daemon Time Error [closed]

up vote 0 down vote favorite I have a legacy system that is running Red Hat Linux 5.4 and the cron daemon will not start. It stopped suddenly, I verified the CMOS time and the system time are correct. ...
0
votes
2answers
89 views

Dynamic change of Linux root password everyday

I want to change my root password everyday based on the date. The password will be like a combination of a string and the date. The below code is working fine. echo -e "pass"$(date ...
0
votes
1answer
660 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
1answer
22 views

CentOS 6 Cron Logging Without Postfix

On a CentOS environment I am setting up, I have no need for email of any kind. I would like to simply disable postfix entirely, however this also disables logging from cron which I do need to have. ...
1
vote
3answers
44 views

Transfering mp3 files from a remote server via cronjob to the RPi without overwriting

I succeded in transfering all files from a folder via ftp from a remote server to a raspberry, but I would like to transfer only new ones. Below is the working script i have. #!/bin/bash -vx ftp -in ...
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 ...
1
vote
3answers
68 views

Shebang does not set SHELL in cron

I have a script containing: #!/bin/bash printenv When I run it from the command line: env testscript.sh bash testscript.sh sh testscript.sh every time, it outputs SHELL=/bin/bash. However, when ...
1
vote
2answers
56 views

My cron job is not sending an email with any output, I see only a blank email

Can someone please help me here. My cron job is not sending an email with output. While I run the shell script manually it generates an email with output. Here is the script looks like #!/bin/bash ...
1
vote
1answer
46 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
vote
2answers
39 views

cronjob timing - for every 3 months

I chanced upon this example: 0 9 1-7 * 1 * First Monday of each month, at 9a.m. I am not sure the 1-7 portion which is supposingly to be the dates of each month. Why is it a ...
11
votes
4answers
4k 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
1answer
25 views

NTP issues on Nagios server

Our Nagios server NTP has isn't working right. First here is the issues: root@ccsd-lx-noc03 /var/log> tail -n 10000 messages | grep "NTP" Jul 5 16:19:36 ccsd-lx-noc03 nagios: SERVICE ALERT: ...
0
votes
2answers
22 views

Why can't split cron logfile up from syslog in bangwagong host?

There are two vps ,one is digitalocean ,oter is bangwagong host. All the os on them are debian7. I want to split cron logfile up from syslog with the following same steps. step1: vim ...
1
vote
1answer
21 views

XRandR script runs correctly from command line, fails as cron job

I'm running LXDE on Fedora 21. My script's purpose is to extend the display across two monitors: #!/bin/sh xrandr --output VIRTUAL1 --off --output LVDS1 --mode 1440x900 --pos 1280x124 --rotate normal ...
0
votes
0answers
22 views

Crontab, adding multicommands using && throws bad minute error [duplicate]

This works as a single command, crontab -l | { cat; echo '*/2 * * * * rm /tmp/*.tar'; } | crontab - One more job also works as a single command, crontab -l | { cat; echo '*/2 * * * * echo ...
4
votes
1answer
59 views

Should the key for an automatically running cron job that runs over ssh not have a passphrase?

I'm reading an article in Master Linux Now 2013 called OpenSSH: Easy Logins and it uses ssh-agent to allow you to enter a passphrase for your key once, and then you're able to connect to a remote ...
3
votes
2answers
700 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 ...
0
votes
2answers
306 views

ipset not executing from crontab

I have this txt files that contains IPs, one per line of file, that I want to block using ipset. I have this bash script that essentially reads from the plain txt file and constructs an array. Then ...
5
votes
3answers
1k 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 ...
1
vote
1answer
42 views

Floating time cron job

I have a Linux host which I would like to have a cron job run on. I do not shut down this machine. I always suspend it. I want to run a job once a day and I cannot set it for a particular time since ...
0
votes
2answers
45 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
9k 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 ...
-1
votes
1answer
44 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
29 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
7k 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 ...
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
24 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
1answer
44 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
50 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 ...
0
votes
1answer
31 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
48 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
12
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
32 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
50 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 ...
2
votes
1answer
24 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
62 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
37 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
32 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
23k 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. ...