cron is a task scheduler based on clock time that runs on Linux-based machines.

learn more… | top users | synonyms

0
votes
0answers
24 views

Run task periodically depending on last successful run

I am looking for a way to manage a script execution. The only requirement is to execute a command depending on the time of the last successful execution. For example: I want to mirror my latest ...
0
votes
0answers
62 views

Macbook with lid down goes back to sleep right after scheduled wakeup

I'm trying to run an app from crontab at 3 in the morning. My 2010 MacBook Pro running OSX 10.7.5 is usually turned off at this time of the night, so I'm setting Energy Saver's scheduled wake up at ...
0
votes
3answers
1k views

SCP not working in CRON job, only manually

I have a script on a remote server (bServer) which SSH's to a central server (let's call it cServer) and kicks a script which further SSH's to 2 other servers (server13 / server14). A script is run on ...
0
votes
1answer
321 views

How to configure in crontab with condition statement for checks

We like to monitor the NAS storage mounted on a Linux box. We only like to be notified via mail when the usage exceeds a certain number, say 80. We have only seen in Linux books where most of them ...
1
vote
2answers
299 views

Run Crontab anytime after 4pm

I am trying to run a script through crontab in osx 10.8.5 that will run at 4:30. 30 16 * * 1-5 /Library/Frameworks/Python.framework/Versions/2.7/bin/python /Users/lego90511/PycharmProjects/Stock\ ...
2
votes
2answers
3k views

Why doesn't my cron.d per minute job run?

I have thrown a bunch of darts trying to get a python script of mine to execute every minute. So I thought I'd simplify it to just do the "simplest thing that could could possibly work" once per ...
2
votes
1answer
95 views

How do I make git fetch ignore my private key?

I'm writing a cronjob that will git fetch. I have a private key that I often use for authenticated git things (like github) which has a passphrase on it, but this specific git fetch doesn't need the ...
0
votes
1answer
125 views

Automated git push attempt does not work - authentication issue

I'm trying to automate a very periodic git add/commit/push cycle using a shell script and cron under OS X 10.8.5. The script is as basic as one would expect it to be: cd /my/directory git add . git ...
0
votes
1answer
470 views

How to delete all files inside public_ftp folder and its sub folders which are older than X days using Cron Job?

I want a way to run Cron job (automatically daily) on server that will delete all files only (not folders) which are older than X days from today's date, in the public_ftp folder and all its sub ...
1
vote
0answers
81 views

Ncat throws errors while being run from crontab

I have a simple script set up on my OpenWrt box to check if one of the computers in a local network is streaming, and if it does, the script starts wget | madplay to play the stream. Script works ...
0
votes
0answers
59 views

How do I launch an hourly version of anacron?

I have a cron job (system update) that fires off every hour. However, I would like it to be reset every time the machine resumes from standby or hibernation. The command is already launched at each ...
3
votes
1answer
4k views

BASH - merge directories when using mv

I just started using BASH, so I can move all contents of a directory to another. But the issue is, I was expecting it to merge the directories. I am using cron job to run this script. #!/bin/bash ...
1
vote
0answers
25 views

crontab does not lauch [duplicate]

I am trying to launch a cron job every hour (an interactive system upgrade). The code that does the actual update ( a no-password sudo yum update) is in my .zshrc (I use zsh as my shell). To launch ...
0
votes
1answer
158 views

Ubuntu — Application global environment variables

So I have an application I am deploying to an Ubuntu 12 server. My application has several "parts" to it: There's a web server, run as part of an upstart script There are cron jobs There are ...
0
votes
0answers
216 views

Crontab command set not working

I'm trying to set up crontab to run a shell script, but for some reason, the script doesn't get executed. I'm on system with OS X 10.8.5. crontab file 0 12 * * 1 /absolute/path/to/myscript.sh 0 15 * ...
0
votes
1answer
58 views

How do I prevent anacron from running certain scripts?

I am running RHEL5 and software RAID (mdadm). Currently I allow the 99-raid-check weekly cron script to run at the normal time (early Sunday morning). However, if the system is off during that time it ...
1
vote
2answers
426 views

Automate python script mac

I want to set up a python script to run every weekday(not sunday and saturday) on my mac OSX 10.8.4. From what I have found so far, it looks like I want to use cron. But before I do something horrible ...
0
votes
2answers
247 views

Script for CRON (FTP get files EVERY MINUTE)

I want to create a script that must run with a CRON every minute (Q: Is it wise to run CRON FTP/wget every minute?) compares local directory with remote directory (Q: do I use FTP or wget and how ...
0
votes
1answer
123 views

Asterisk cron page/intercom script

Wanting to send a page/intercom message to a group of VoIP phones as specified intervals. Is it possible to schedule asterisk to send a page/intercom via cron or some other method? What would be the ...
0
votes
3answers
614 views

Linux crontab script to “mysqldump | gzip” gives wrong filesize

I have a bin/bash script that mysqldumps my sql database, when I run it everything goes well with filesize=3MB, but when crontab(as sudo) runs the script then the filesize is 20B script #!/bin/bash ...
0
votes
1answer
276 views

Cron fails the script command

I am trying to capture a picture with my webcam and I need to log the output to check for errors, but cron is failing at this. I am able to do this from terminal, but cron running it doesn't work. ...
1
vote
0answers
78 views

setting a cronjob in IST time [closed]

I am trying to set a cronjob run in a different timezone..i have goolged a lot and found editing /etc/default/cron is the way to go...but this file is deprecated and I see the following message,so I ...
0
votes
1answer
902 views

Can I use cron or launchd to run a bash script without being logged in?

I'd like to have a simple bash script run (regardless of whether anyone is logged in or not) akin to putting it in /etc/cron.daily/ on Linux, but on Mac OS X Mountain Lion 10.8.4. If it's possible, ...
0
votes
1answer
92 views

Reset user password on reboot

Humor me for a moment because I'm aware that this is a terrible idea. I'm trying to devise a way to reset a user's password each time the computer is rebooted. So far, I've tried the following to no ...
0
votes
3answers
869 views

How to schedule/unschedule cron job from shell

I have a ubuntu server where I put my application core. It's a jar that needs to be always listening for requests. I made a script to run it with the correct parameters. The scenario is similar to ...
3
votes
1answer
1k views

Debian cron.daily messages

Every week, I seem to be getting the following two Cron messages: /etc/cron.daily/logrotate: gzip: stdin: file size changed while zipping /etc/cron.daily/spamassassin: channel: no ...
0
votes
3answers
445 views

Run crontab non-interactively from script

I would like to schedule some tasks on remote servers by script but am having an issue with crontab expecting to be run interactively the first time. As far as I understand crontab needs to be ...
1
vote
2answers
2k views

How to auto commit to my git repository using cron?

I look into a lot of answers about this subject, but something is wrong here, let me explain. I create this script, to make my cron cleaner :) #!/bin/bash cd ...
0
votes
2answers
1k views

apache crontab not executing

I use cron to execute some php scripts (owncloud background tasks etc). My server runs nginx and PHP via php-fpm, which by default runs PHP processes under the apache user, the only user with write ...
0
votes
3answers
191 views

Automatically Create text file of folder contents

I have a set of directories that have files in them for use with LiquidSoap for use with IceCast2 Currently, every time I remove a file or add a file, I have to edit the txt file listing the mp3s to ...
1
vote
1answer
34 views

Persistent outgoing connection from firewalled Linux box

There's a great method to allowing one to access a machine behind a firewall by creating an outgoing listening connection: Remote into Linux workstation behind a firewall My question is, what's the ...
1
vote
2answers
522 views

Script for transferring files over the internet via a Cron task

I want to add a bit to a backup script that will transfer a file to another server, over the internet. My cron currently does a pg_dump of a database into a file on the local machine, I want to then ...
-2
votes
1answer
473 views

changing ownership of files within a bash script

I have this bash script which outputs the first two files as owned by user, and the next three as owned by root: ################################################## # Variables NUM="6" #number of ...
2
votes
1answer
176 views

Running Redshift commands from crontab, doesn't work

About redshift: Redshift adjusts the color temperature of your screen according to your surroundings. This may help your eyes hurt less if you are working in front of the screen at night. A typical ...
5
votes
1answer
238 views

Why does cron only offer minute granularity?

It feels like there are use cases for things you'd want to run once every 5 seconds, twice a minute, etc, but these are impossible with cron. Why hasn't second-level cron granularity been built into ...
0
votes
2answers
663 views

How to setup muliple cron job every 3 hours but not simultaenously?

I need to run cron jobs during the following times: 1st job: 1PM 4PM 7PM etc.. 2nd job: 1:15PM 4:15PM 7:15PM etc.. 3nd job: 1:30PM 4:30PM 7:30PM etc.. As you can see each job run every 3 hours but ...
0
votes
1answer
1k views

ntpdate command not found [only when using with cron]

I have a linux machine with ntpdate installed and it is working when i run it from my ssh terminal or from a shell script manually. However , when i add the shell script to crontab i get the error ...
0
votes
1answer
144 views

Does cron still run for disabled users?

If a user is disabled (with passwd -l user) on a server, are their cron jobs also disabled? Or would they still run?
2
votes
2answers
765 views

Working with git via crontab

I have the following shell script #!/bin/bash REPODIR=$HOME/work/repository/ cd $REPODIR var=`git fetch --dry-run 2>&1` echo $var > $HOME/error.txt I want to run my script every minute, ...
1
vote
2answers
462 views

os.popen returns empty string when called from cron

I'm trying to get my Raspberry Pi's CPU usage like so: def get_cpu_usage(): return os.popen("top -n1 | awk '/Cpu\(s\):/ {print $2}'").readline().strip() When executed normally, this method ...
1
vote
2answers
342 views

Cron to run command once a day, no mather what time

I want to run a cron command only once a day but not at a specific time as the times my computer is on are unpredictable. Can I do it?
1
vote
0answers
81 views

Enabling crontab logging on openSUSE

I am trying to enable the crontab log on openSUSE 11.3. I searched the web but couldn't find how to do it. I only find information about Ubuntu. Tried editing the /etc/rsyslog.d/remote.conf file but I ...
1
vote
1answer
167 views

cron executing twice based on day of the week

I have a question. We have a cron job that executed on the 15th of this month: min hr day month day_of_week 35 13 15 6 6 However, it executed again on June 22nd (which was the 6th day of the ...
1
vote
1answer
800 views

How can I set a system wide PATH-variable for cron on Centos 6.4

I'd like to make sure that every user specific crontab has the same PATH-environment. I tried to set the PATH in /etc/crontab but it seems like this config file is not read by crond. Following are ...
1
vote
1answer
118 views

How can I conditionally start a service based on the current local time using Mint Linux 15?

I have set up cron jobs which stop services at 2:00 AM and then restarts them at 8:00 AM. However, my enterprising users (my family; securing the box isn't a possibility) have determined that if they ...
1
vote
1answer
54 views

Directory permission with crontab

I have a directory my_website/public, which I did chmod 777 on. I set up a cronjob to delete all the files in my_website/public/photos/* But I got an email notification saying that rm does not have ...
0
votes
3answers
127 views

OsX Crontab having no effect

I am dynamically appending cron tasks to the user crontab The tasks seem to be getting adde, crontab -e looks like: */10 * * * * /bin/sh /Users/john/Kiosk/app/content/update.sh @reboot /usr/bin/open ...
-1
votes
0answers
157 views

Remove expired cron jobs from quartz schedule [closed]

I have some quartz jobs that run only once. They are scheduled with CronTrigger. How can I remove expired cron jobs from quartz schedule?
1
vote
1answer
90 views

Job shows up in crontab -l but not in /etc/crontab

There is a certain job that shows up when I do $ crontab -l and I can verify that this is also running. However, the job is not listed in /etc/crontab. Say the job is /somedir/somefile I can't ...
1
vote
1answer
91 views

Why this cronjob wont run

On debian squeeze as user root I add this cronjob with "crontab -e" */1 * * * * root /usr/sbin/ntpdate ptbtime1.ptb.de >> /var/log/ntpdate.log But this cronjob will not run, there is also ...