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

learn more… | top users | synonyms (1)

1
vote
1answer
394 views

Shell Script does not send email from Cron job [duplicate]

I have a shell script which sends email when the disk is more than 80% full; when I run the script as sh -x script.sh or ./script.sh I get an email but when I keep the script in cronjob I do not get ...
0
votes
0answers
24 views

Move files that are 7 days or older, cronjob [duplicate]

I want to move some log files that are 7 days or older to another folder and then delete those files after another week. I'm using logrotate to create a new log file every 2 hours in a folder. I ...
2
votes
3answers
214 views

Shell script executed with cron results in different size file than executed manually

I have a RHEL server that I am running a MySQL database on. I have a Bash script that executes mysqldump that creates a backup file. The backup file created when executing the script directly in ...
0
votes
1answer
48 views

Clear X clipboard using cron [duplicate]

Is there any way I can clear the X clipboard from a cron job? The usual commands for xclip don't seem to work. echo -n | xclip -selection clipboard doesn't work from cron.
0
votes
1answer
489 views

AWS CLI - not working in a crontab

I can run the command aws --version in a script and in the cli. But if I put this command into a crontab it does not work. Crontab: 50 12 * * * aws --version > ~/yolo.swag Error: /bin/sh: 1: ...
0
votes
3answers
45 views

Cron service running but not visible by “top”

I'm on my freeBSD server. Cronjob suddenly stop working. When I run "top" the service is not listed. But when i check "service cron status" , it is running with given PID. I restarted the service ...
1
vote
2answers
126 views

What's the most efficient way to log crontab shell script errors with error occurred time?

A common way to log crontab task errors looks like below: 1 */8 * * * sh /pseudo_path/test.sh 2>> my_err_log It's a concise command, but it can't record the error occurred time, and the path ...
0
votes
1answer
202 views

(SOLVED) 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 && ...
4
votes
2answers
505 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 ...
0
votes
2answers
187 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 ...
2
votes
1answer
53 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
132 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
69 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. ...
2
votes
3answers
141 views

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

I succeeded in transferring 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 ...
1
vote
3answers
172 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
486 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
2answers
496 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 ...
0
votes
1answer
190 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
50 views

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

There are two vps: one is digitalocean, the other is bangwagong host. All the operating systems on them are Debian7. I want to split cron logfile up from syslog with the following steps. step1: vim ...
1
vote
1answer
130 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 ...
1
vote
2answers
292 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?
4
votes
1answer
129 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 ...
1
vote
1answer
49 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 ...
1
vote
1answer
123 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
140 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
52 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 ...
0
votes
2answers
135 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 ...
-1
votes
2answers
193 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 ...
0
votes
1answer
84 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
678 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 comes about because the script in crontab doesn't work, ...
0
votes
1answer
170 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
223 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
vote
1answer
156 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
176 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
395 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 ...
2
votes
1answer
276 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
3answers
87 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
324 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 ...
1
vote
2answers
63 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 ...
1
vote
1answer
59 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
153 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
123 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:~# ...
1
vote
0answers
41 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
121 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 ...
1
vote
2answers
116 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
1answer
1k 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 ...
2
votes
3answers
1k 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
504 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
3answers
120 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 ...