Crontab is a short form of cron table. It is a configuration file that specifies shell commands to run periodically on a given schedule.

learn more… | top users | synonyms

0
votes
0answers
17 views

Linux Laptop shutting down on battery level bellow 8%

I've written an crontab entry that runs a script in my home directory as user. That notifies me if I forgot to switch the power brick on. This works fine. BATTERY=$(upower -e | grep 'BAT') ...
0
votes
0answers
15 views

logrotate files older than x hours

What's wrong with this rotate.conf? Goal is to delete only files older than four hours path/to/tokens/*.tkn { nosharedscripts prerotate if test `stat --format=%Y $1` -le $(( `date +%s`...
60
votes
7answers
133k views

Run a command every week with Cron?

Simple question- what would a crontab entry look like for a command I want to run every week on Saturday at 8:05 AM?
1
vote
0answers
22 views

Set sciTE as default crontab editor

I am trying to set sciTE as my default text editor, but when I run the commands below it errors. Is it possible to use sciTE as default editor in Ubuntu Mate? And how would I achieve such? test@...
0
votes
0answers
3 views

Install cronjob from file to a specific user

I have an install script that sets up a user. Using the install script, I want to apply a cronjob that gets executed by that user (myuser): 0 4 * * * /home/myuser/script-to-run-at-4am.sh I have ...
1
vote
0answers
28 views

Ubuntu, sending file through bluetooth

I want to send a file named read.txt using command: bluetooth-sendto. It works using the direct command on terminal bluetooth-sendto --device=MACADDR path/to/read.txt. I want to execute it with this ...
3
votes
2answers
26 views

root crontab not executing

I'm setting up my Debian server to backup my databases with crontab, the mysqldump utility and gunzip. For some reason, my crontab lines appear to fail, especially the crucial one: 15 2 * * * /usr/...
0
votes
0answers
11 views

Script works manually but not from crontab

I created a job (run_myjob.sh) to run an executable file (myjob) that creates a backup file every Monday morning at 06:00. The executable requires the output file name to be passed to it (including ...
0
votes
2answers
33 views

cron job on centOS 6.5

I have used these 2 references to insert a new crontab entry. redhat ubuntu I have created a new bash file and moved it to /usr/bin. That sh file has execute permissions for the root user and the ...
3
votes
2answers
99 views

How to start a screen session from a shell script using crontab and then reattach to it?

I want to run the following shell script (launch.sh) to start/stop a screen session using crontab !/bin/bash cd ~/screen DATE_FORMAT=+%Y-%m-%d:%H:%M:%S echo --- START --- date $DATE_FORMAT if [ -...
0
votes
2answers
107 views

Can't start a job with Cron on Ubuntu startup

I am trying to get a simple Python script running on startup with Cron on Ubuntu 16.04. What I did is opened cron with: sudo crontab -e and added the last line as shown in the screenshot: Then I ...
0
votes
1answer
62 views

Failed to edit crontab (linux Alpine)

I faced with an error during cron manipulation under my non-root account. bash-4.3$ crontab -e crontab: must be suid to work properly Here is an output on id command: bash-4.3$ id uid=41532(fred) ...
1
vote
5answers
7k views

Disable cron jobs for a specific user

I have a list of jobs in the crontabs for user1, user2. I want to prevent the jobs of user2 from running. I tried listing user2 in cron.deny, but that only prevents him from accessing his crontab. ...
0
votes
0answers
17 views

cron expression day of month AND day of week, instead of OR?

Probably not, but is there any way to make DOM and DOW in a cron expression be an AND relationship? For example: "0 0 1-7 * thu" Means: At 00:00 on the 1, 2, 3, 4, 5, 6 and 7th of every month and ...
0
votes
1answer
159 views

Cron jobs on IBM i 7.1

I just found out today that on an IBM i system I am able to use SSH to get to a Unix-like terminal (AIX/PASE) and would like to use this to schedule automated tasks using crontab. Does anyone know if ...
1
vote
1answer
57 views

rsnapshot: What's wrong with my crontab?

I am using Rsnapshot for backups (Linux CentOS 6). Here is my /etc/cron.d/rsnapshot: 30 11 * * * root /usr/bin/rsnapshot nowandthen > /backups/rsnapshot_cron.txt 2>&1 15 11 * * 4 root ...
4
votes
3answers
11k views

Running Cronjobs as per Local Time rather than Universal Time

On running dpkg-reconfigure tzdata in terminal and i get 2 different time on my machine Local time is now: Wed May 1 11:58:55 IST 2013. Universal Time is now: Wed May 1 06:28:55 UTC 2013. ...
0
votes
1answer
20 views

Centos freezes, when trying to open crontab

I'm trying to open crontab, but when i type it the whole os just freezes... I thought, maybe that's because vim isn't installed, but it is. I also checked the cron.allow and cron.deny files, but they ...
5
votes
2answers
14k views

Bad minute in crontab?

I get the following error in my syslog: Oct 17 13:14:03 tracker cron[873]: (*system*) ERROR (Syntax error, this crontab file will be ignored) Oct 17 13:14:03 tracker cron[873]: Error: bad minute; ...
-1
votes
1answer
25 views

How to create a variable in crontab for a date from last week

I am trying to set up a cron job, using a script that needs to be occasionally run interactively. So far it looks like this: 59 1 * * 1 /weekly.csh date +\%Y\%m\%d date +\%Y\%m\%d >> log What I ...
1
vote
1answer
50 views

Where is my crontab file on OS X?

Moving to a new laptop I've lost my old cron setup. I'd like to include it in my backup going forward. Where is it located?
0
votes
0answers
96 views

Loading kerberos keytab from root cron

When I run a script (see below) to load a kerberos keytab from a users cron it works just fine. Running it from root cron however a password is asked for the keytab and it aborts with: kinit: Generic ...
1
vote
2answers
2k views

Crontab command cannot be executed. Error PAM configurations

Here's the command that I would like to execute but it seems not to work. [mdubois@veloce ~]$ crontab -l Autorisation refusée You (mdubois) are not allowed to access to (crontab) because of pam ...
1
vote
1answer
43 views

why don't cron jobs in /etc/cron.d directory appear in crontab -e?

I do sudo crontab -e and see a bunch of cronjobs. If a cron exists in /etc/cron.d but not in sudo crontab -e does that mean it's not being ran? Or is it being ran but just isn't showing up for ...
0
votes
1answer
21 views

echo does not apply a line to crontab

Want to apply this to crontab: crontab -l > nopass echo 'ALERT - Found a user without password on:' `hostname` `date` | cat /etc/shadow | awk -F: '($2==""){print $1}' | mail -s "Alert: Found a ...
0
votes
0answers
112 views

Crontab Ubuntu 14

I have a problem with crontab, I can not add new task I try to add new line * /5 * * * /usr/bin/rsync -avz /home/fm-x2/Dokumenty/pliki /mnt/share/homedir/ EDITOR="gedit" crontab -e or crontab -e ...
23
votes
2answers
19k views

Difference between /etc/crontab and “crontab -e”

What is the difference between the crontab located in /etc/crontab and the crontab that can be edited using crontab -e?
0
votes
2answers
854 views

Why does this bash script give an error on Ubuntu but not OSX

#!/usr/bin/env sh export $NODE_CONFIG_DIR=/Users/full/path/to/script/config cd /Users/full/path/to/script /usr/local/bin/node main The script runs locally on OSX (if I adjust the paths for the local ...
1
vote
1answer
422 views

use multiple @reboot commands in crontab

I searched this website and Google but couldn't find it.. How can I execute two (or more) commands using @reboot ? What I have now: @reboot /root/website1/starter.sh What I want: @reboot /root/...
0
votes
2answers
541 views

Why is this cronjob not working?

I have a ruby script in ~/custom_scripts/get_all_products.rb. I want it to run every night at 04:00. Here's what the cronjob in crontab -e looks like: MAILTO="<email>" 0 4 * * * ruby ~/...
9
votes
1answer
940 views

Cronjob runs before the scheduled time, what could be wrong?

I have below crontab scheduled for Saturday that falls between days 19-23, I' m not sure why it ran on 20th (Friday). Any guesses? 00 21 19-23 * 6 <command>
0
votes
1answer
123 views

Cron strange behaviour

I've got a Bash script with all the permission to be excecuted, I attach it to to a cron job, this script basically only kill and restart a specific process, the strange behaviour is that if i run the ...
17
votes
6answers
130k views

How to execute shell script via crontab?

I have a notify.sh script that looks like: notify-send "hi welcome" My crontab notification for 2 PM: 0 14 * * * home/hacks/notify.sh However, this doesn't work. What is the problem?
12
votes
8answers
18k views

Run a cron job on the first Monday of every month?

I'd like to run a job from cron at 8.30 on the first Monday of every month. The cron Wikipedia page says While normally the job is executed when the time/date specification fields all match ...
0
votes
0answers
157 views

Cannot write to text file from python

I have a program in python, which takes data's from system and puts them to the text file line by line. Everything works properly when I run it from terminal using: python myprogram.py Every-time I ...
0
votes
0answers
35 views

I want to run a script that will disable my touchpad

I want run a script that will disable my touchpad and it will run every minute. 1. My script is: if [ `lsusb | wc -w` == '76' ] then `/usr/bin/xinput set-prop 16 "Device Enabled" 0` else `/usr/bin/...
12
votes
2answers
11k views

Run a cron job every 5 minutes between two times

Is there a way to specify a job that runs every 5 minutes between some start time and some end time on business days in a crontab? Update I think it's relevant that my start and end times are not at ...
3
votes
4answers
2k views

crontab still sending emails even with > /dev/null

I have a crontab (root) that runs a script and output is set to > /dev/null but I always get the emails whenever it runs. I only want to receive error emails. # Rackspace driveclient update (12pm MST)...
1
vote
2answers
60 views

Crontab expression for run once between time range that crosses midnight

Is it possible to come up with a cron expression that runs every five minutes between 12th October 2015 19:00 and 13th October 2015 07:00?
2
votes
2answers
385 views

View the event list of a cron file

I have a relatively complex set of cron jobs running and it would be really useful for me to ask the system for the list of the next n cron tasks that will be performed. So given a particular ...
0
votes
0answers
90 views

Execute crontab as root not working

I need to execute a backup script each night. When I execute manually, backup is done without problems, but I use sudo crontab -e and add the script there: root@SF-DES-SVN:/home/svn# crontab -l # m h ...
0
votes
1answer
84 views

Backing up user accounts in linux

Following is my steps to backup user accounts with scheduling: `sudo crontab -e. 0 0 * * * sudo tar -cpzf /backupfolder/user1_backup-$(date +\%Y--\%m-\%d).tar.gz /home/students/user1 0 0 * * * sudo ...
0
votes
1answer
103 views

Crontab doesn't run my schedule backup on Ubuntu

I created a backupfolder in my root directory. Following is my command to run a backup task in crontab -e: * * * * * sudo tar -cvpzf /backupfolder/user1_backup-$(date +%Y--%m-%d).tar.gz /home/...
5
votes
3answers
4k views

Only email on cron errors for jobs in cron.daily, cron.hourly, etc

I have several cron jobs that run (in /etc/cron.daily, /etc/cron.hourly, /etc/cron.weekly, etc.) and email root@localhost with the results. I'd like to stop those emails if the jobs are succeeding, ...
0
votes
2answers
56 views

Cron expression hour 1/12

I'm looking at a system where someone added a cronjob which schedule is like this: 0 1/12 * * * doSomething More commonly, if the hours part in the schedule were */12 then it would execute every 12 ...
0
votes
1answer
303 views

Crontab scheduled backup not running

I need to have the ZIP compression happen on a different drive than the server due to limited space. Here is the command is the line I use in crontab: 00 1 * * * osmc cd /media/SAMSUNG/backups/work/...
-1
votes
1answer
157 views

Why is this crontab not working?

I'm a crontab beginner. Why does this crontab do nothing? I would like it to run the script every minute. 1 * * * * /home/android/test.sh If I just type /home/android/test.sh in the shell it works ...
1
vote
1answer
182 views

How to configure a cron.d crontab file for root

What's the procedure for installing a cron.d crontab file to be run as root? I have a script I want root to run every 10 minutes, so I installed the file /etc/cron.d/mycron: SHELL=/bin/bash PATH=/...
0
votes
1answer
219 views

Cron Error : chdir failed (/usr/share/httpd): - Using Nginx

(CRON) ERROR chdir failed (/usr/share/httpd): No such file or directory I checked the log and found the following error. Why does cron tries to change the directory? I am not using httpd. I am ...
0
votes
1answer
30 views

Cron file in cron.d isn't running at all, why?

I am unable to run my cron file stored at /etc/cron.d but it wouldn't run for unknown reasons :/ can someone please help? Content of my cron file is as follows: PATH=/usr/local/sbin:/usr/...