Questions tagged [crontab]

Command used to schedule commands to be executed periodically. It reads a series of commands from standard input and collects them into a file known as a "crontab" which is later read and whose instructions are carried out.

34 questions
73
votes
6 answers

Cron.hourly won't run

Ok, So I've made my script, I dropped it in /etc/cron.hourly then I chmod 777 the file but it won't run (automatically). If I manually run it, it works fine. Do I need to do anything else?
Switchkick
  • 3,963
27
votes
4 answers

Cron Job Not Running?

I have a crontab file that looks like this: * * * * * /home/abliskovs/update/update.sh However when I check the syslog for evidence that the job has run, there is nothing that might indicate that it ever ran. How can I check if it's running? crontab…
12
votes
4 answers

"Backup Intervals" in rsnapshot.conf?

A simple question about rsnapshot. In order to perform daily backups I'm going to add lines to cron in my Ubuntu. Then, why do I have also these lines in the rsnapshot.conf ? ######################################### # BACKUP INTERVALS …
aneuryzm
  • 899
11
votes
2 answers

Is there a programmable way to tell if the screen is locked?

I have lots of stuff in my crontab, including some that talks to my screen. If I'm not there for it to be notifying, I don't really want it to run. Is there a way I can check to see if the computer is locked, so I can keep it from doing things when…
10
votes
9 answers

How to run cron job when network is up?

I have some anacron jobs which run daily. The scripts update local bzr and git repositories. Naturally these scripts need working network connections. I'm on a laptop and often wired and wireless internet do not come up fast enough. This causes my…
Dima
  • 9,955
7
votes
5 answers

What's wrong with my cron.hourly configuration?

Every hour I get an email with error like this, Subject: Cron root cd / && run-parts --report /etc/cron.hourly /bin/sh: root: not found Contents of /etc/crontab is as follows, either I remove user "root" or not (6th column), I get…
grokus
  • 631
6
votes
2 answers

How to activate this crontab?

I have a setup as below but its never getting executed. $ chmod +x /var/tmp/myscript.sh $ vim /var/tmp/crontab.sh; * * * * * sleep(10); /var/tmp/myscript.sh $ crontab /var/tmp/crontab.sh Now just, noticed its not working. What am i doing wrong? $…
user25165
5
votes
4 answers

execute script after desktop loaded?

I want to execute bash script on startup that opens several terminals in different workspaces. Script works just fine if I call it from terminal, but it doesn't work if executed from crontab using @reboot: #!/usr/bin/env bash #1 make sure we have…
Stann
  • 15,416
4
votes
2 answers

Is it bad to have a long list in my crontab?

I'm toying around with building an application to display messages on the screen on a desired intervals. I want to use cron to achieve that and I am considering my options. The most naive approach would be to print the commands directly into…
Yotam
  • 1,468
4
votes
3 answers

Backup bash script is not gzipping its tarball

I have a bash script that runs as a cron to backup files on the server. #!/bin/bash FILE=/path/to/backup_$(date +%Y%m%d).tar tar -cf $FILE /backup/this /and/that /and/someotherfiles gzip $FILE When I run the script directly using: sudo bash…
bcmcfc
  • 848
3
votes
3 answers

Scripts in crontab don't get executed at all

i did something as simple as this: crontab -e * * * * * touch /home/alexis/hi.txt crontab: installing new crontab but it doesn't work at all; not mentioning more complicated scripts. any idea what went wrong?
Alexis
  • 51
3
votes
2 answers

setting editor for crontab -e , why always using basic vim?

When issuing crontab -e as root , i always got messages like the following (partial) , however , executing vim directly doesn't have problems at all. $EDITOR was set to vim in /root/.bash_profile already. %> sudo crontab -e Error detected while…
daisy
  • 6,712
3
votes
3 answers

Trying to stop a service with cron

On my Ubuntu 11.04 server when I try to run service powernap stop as a cron job with the root user, it fails and gives me this message in syslog NAS CRON[10853]: (CRON) error (grandchild #10854 failed with exit status 2) and this is emailed to…
3
votes
1 answer

How to use crontab, .netrc, and git push?

I am in the process of automating the backups from various servers to a central point then pushing those config changes into a git repo so I can track any changes over time. The rest of the scripts are working well, I can copy/rsync the files…
Jon
  • 233
2
votes
1 answer

cron.weekly does not run

I have a shellscript in /etc/myprog/myscript.sh that I would like to run every week. Therefore I created a symbolic link in /etc/cron.weekly: root@ip-10-190-199-197:/etc/cron.weekly# ls -ltr total 8 -rwxr-xr-x 1 root root 895 2011-07-27 11:32…
1
2 3