You are not logged in.

#1 2017-06-14 07:04:56

masterofamn
Member
Registered: 2012-05-09
Posts: 28

[SOLVED] crontab woes

Hi,

on my new Arch install I have a stupid problem with cronie:

I want to run a backup script at 03:00am each day of each week of each month and my crontab therefore looks like this;

$ crontab -e

MAILTO=me@work.com
* 3 * * * /path/to/my/backup/script.sh 2>&1 | /usr/bin/logger -t BACKUP

What is happening is, that this job indeed fires at 03:00 - but from then on it is repeated every minute until 04:00 spamming my machine with rsyncs and mail reports.

syslog:

Jun 14 02:01:01 CROND[2607]: (root) CMD (run-parts /etc/cron.hourly)
Jun 14 03:00:01 CROND[2802]: (me) CMD (/path/to/my/backup/script.sh)
Jun 14 03:01:01 CROND[2825]: (me) CMD (/path/to/my/backup/script.sh)
Jun 14 03:02:01 CROND[2840]: (me) CMD (/path/to/my/backup/script.sh)
...56 MORE...
Jun 14 03:59:01 CROND[3761]: (me) CMD (/path/to/my/backup/script.sh)
Jun 14 04:01:01 CROND[3773]: (root) CMD (run-parts /etc/cron.hourly)

Anything obvious I am doing wrong?

best,

MoA

Last edited by masterofamn (2017-06-14 07:48:28)

Offline

#2 2017-06-14 07:14:49

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] crontab woes

Paste your backup script.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2017-06-14 07:21:41

ua4000
Member
Registered: 2015-10-14
Posts: 566

Re: [SOLVED] crontab woes

masterofamn wrote:

Hi,
What is happening is, that this job indeed fires at 03:00 - but from then on it is repeated every minute until 04:00 spamming my machine with rsyncs and mail reports.

This is, because you have defined this exactly in your cronjob: hour=3  + minute=all=*

change it to e.g.

13 3 * * *

to start it only once at 03:13 every day.

The sytax is "minute hour day_of_month month day_of_week command" - see the wiki https://wiki.archlinux.org/index.php/Cron

Last edited by ua4000 (2017-06-14 07:22:13)

Offline

#4 2017-06-14 07:48:14

masterofamn
Member
Registered: 2012-05-09
Posts: 28

Re: [SOLVED] crontab woes

head->desk

thanks @ua4000.

Offline

Board footer

Powered by FluxBB