You are not logged in.

#1 2009-09-15 23:30:56

iamsmrt
Member
Registered: 2009-08-12
Posts: 138

Backups in cron not running

I'm trying to run rsnapshot through cron to automate my backups but it's not actually running rsnapshot for some reason sad. Here's my crontab:

brian@brian-laptop:/var/log$ sudo crontab -l
#
# DO NOT EDIT THIS FILE MANUALLY!! USE crontab -e INSTEAD.
#

# <minute> <hour> <day> <month> <dow> <command>


01 * * * *  /usr/sbin/run-cron /etc/cron.hourly
02 00 * * * /usr/sbin/run-cron /etc/cron.daily
22 00 * * 0 /usr/sbin/run-cron /etc/cron.weekly
42 00 1 * * /usr/sbin/run-cron /etc/cron.monthly
00 *  * * * pacman -Sy
00 00 * * * rsnapshot sync && rsnapshot daily
30 23 * * 0 rsnapshot weekly
00 23 1 * * rsnapshot monthly

And here's one of my logs:

14-Sep-2009 00:02  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
14-Sep-2009 01:00  FILE /var/spool/cron/root USER root pid 12703 cmd pacman -Sy
14-Sep-2009 01:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
14-Sep-2009 01:01  FILE /var/spool/cron/root USER root pid 12859 cmd /usr/sbin/run-cron /etc/cron.hourly
14-Sep-2009 02:00  FILE /var/spool/cron/root USER root pid 21677 cmd pacman -Sy
14-Sep-2009 02:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
14-Sep-2009 02:01  FILE /var/spool/cron/root USER root pid 21817 cmd /usr/sbin/run-cron /etc/cron.hourly
14-Sep-2009 03:00  FILE /var/spool/cron/root USER root pid 30278 cmd pacman -Sy
14-Sep-2009 03:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
14-Sep-2009 03:01  FILE /var/spool/cron/root USER root pid 30442 cmd /usr/sbin/run-cron /etc/cron.hourly
14-Sep-2009 04:00  FILE /var/spool/cron/root USER root pid 6681 cmd pacman -Sy
14-Sep-2009 04:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
14-Sep-2009 04:01  FILE /var/spool/cron/root USER root pid 6818 cmd /usr/sbin/run-cron /etc/cron.hourly
14-Sep-2009 05:00  FILE /var/spool/cron/root USER root pid 15516 cmd pacman -Sy
14-Sep-2009 05:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
14-Sep-2009 05:01  FILE /var/spool/cron/root USER root pid 15671 cmd /usr/sbin/run-cron /etc/cron.hourly
14-Sep-2009 06:00  FILE /var/spool/cron/root USER root pid 24200 cmd pacman -Sy
14-Sep-2009 06:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
14-Sep-2009 06:01  FILE /var/spool/cron/root USER root pid 24342 cmd /usr/sbin/run-cron /etc/cron.hourly
14-Sep-2009 07:00  FILE /var/spool/cron/root USER root pid 400 cmd pacman -Sy
14-Sep-2009 07:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
14-Sep-2009 07:01  FILE /var/spool/cron/root USER root pid 547 cmd /usr/sbin/run-cron /etc/cron.hourly
14-Sep-2009 08:00  FILE /var/spool/cron/root USER root pid 9408 cmd pacman -Sy
14-Sep-2009 08:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
14-Sep-2009 08:01  FILE /var/spool/cron/root USER root pid 9546 cmd /usr/sbin/run-cron /etc/cron.hourly
14-Sep-2009 09:00  FILE /var/spool/cron/root USER root pid 18144 cmd pacman -Sy
14-Sep-2009 09:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
14-Sep-2009 09:01  FILE /var/spool/cron/root USER root pid 18284 cmd /usr/sbin/run-cron /etc/cron.hourly
14-Sep-2009 10:00  FILE /var/spool/cron/root USER root pid 27364 cmd pacman -Sy
14-Sep-2009 10:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
14-Sep-2009 10:01  FILE /var/spool/cron/root USER root pid 27503 cmd /usr/sbin/run-cron /etc/cron.hourly
14-Sep-2009 11:00  FILE /var/spool/cron/root USER root pid 3767 cmd pacman -Sy
14-Sep-2009 11:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
14-Sep-2009 11:01  FILE /var/spool/cron/root USER root pid 3908 cmd /usr/sbin/run-cron /etc/cron.hourly
14-Sep-2009 12:00  FILE /var/spool/cron/root USER root pid 12373 cmd pacman -Sy
14-Sep-2009 12:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
14-Sep-2009 12:01  FILE /var/spool/cron/root USER root pid 12523 cmd /usr/sbin/run-cron /etc/cron.hourly
14-Sep-2009 13:00  FILE /var/spool/cron/root USER root pid 20993 cmd pacman -Sy
14-Sep-2009 13:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
14-Sep-2009 13:01  FILE /var/spool/cron/root USER root pid 21135 cmd /usr/sbin/run-cron /etc/cron.hourly
14-Sep-2009 14:00  FILE /var/spool/cron/root USER root pid 29677 cmd pacman -Sy
14-Sep-2009 14:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
14-Sep-2009 14:01  FILE /var/spool/cron/root USER root pid 29846 cmd /usr/sbin/run-cron /etc/cron.hourly
14-Sep-2009 15:00  FILE /var/spool/cron/root USER root pid 6484 cmd pacman -Sy
14-Sep-2009 15:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
14-Sep-2009 15:01  FILE /var/spool/cron/root USER root pid 6642 cmd /usr/sbin/run-cron /etc/cron.hourly
14-Sep-2009 16:00  FILE /var/spool/cron/root USER root pid 15169 cmd pacman -Sy
14-Sep-2009 16:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
14-Sep-2009 16:01  FILE /var/spool/cron/root USER root pid 15313 cmd /usr/sbin/run-cron /etc/cron.hourly
14-Sep-2009 17:00  FILE /var/spool/cron/root USER root pid 23857 cmd pacman -Sy
14-Sep-2009 17:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
14-Sep-2009 17:01  FILE /var/spool/cron/root USER root pid 24008 cmd /usr/sbin/run-cron /etc/cron.hourly
14-Sep-2009 18:00  FILE /var/spool/cron/root USER root pid 32527 cmd pacman -Sy
14-Sep-2009 18:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
14-Sep-2009 18:01  FILE /var/spool/cron/root USER root pid 32665 cmd /usr/sbin/run-cron /etc/cron.hourly
14-Sep-2009 19:00  FILE /var/spool/cron/root USER root pid 9080 cmd pacman -Sy
14-Sep-2009 19:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
14-Sep-2009 19:01  FILE /var/spool/cron/root USER root pid 9224 cmd /usr/sbin/run-cron /etc/cron.hourly
14-Sep-2009 20:00  FILE /var/spool/cron/root USER root pid 17660 cmd pacman -Sy
14-Sep-2009 20:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
14-Sep-2009 20:01  FILE /var/spool/cron/root USER root pid 17804 cmd /usr/sbin/run-cron /etc/cron.hourly
14-Sep-2009 21:00  FILE /var/spool/cron/root USER root pid 26715 cmd pacman -Sy
14-Sep-2009 21:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
14-Sep-2009 21:01  FILE /var/spool/cron/root USER root pid 26856 cmd /usr/sbin/run-cron /etc/cron.hourly
14-Sep-2009 22:00  FILE /var/spool/cron/root USER root pid 3354 cmd pacman -Sy
14-Sep-2009 22:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
14-Sep-2009 22:01  FILE /var/spool/cron/root USER root pid 3505 cmd /usr/sbin/run-cron /etc/cron.hourly
14-Sep-2009 23:00  FILE /var/spool/cron/root USER root pid 12142 cmd pacman -Sy
14-Sep-2009 23:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
14-Sep-2009 23:01  FILE /var/spool/cron/root USER root pid 12305 cmd /usr/sbin/run-cron /etc/cron.hourly
15-Sep-2009 00:00  FILE /var/spool/cron/root USER root pid 20952 cmd pacman -Sy
15-Sep-2009 00:00  FILE /var/spool/cron/root USER root pid 20953 cmd rsnapshot sync && rsnapshot daily
15-Sep-2009 00:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
15-Sep-2009 00:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
15-Sep-2009 00:01  FILE /var/spool/cron/root USER root pid 21098 cmd /usr/sbin/run-cron /etc/cron.hourly
15-Sep-2009 00:02  FILE /var/spool/cron/root USER root pid 21246 cmd /usr/sbin/run-cron /etc/cron.daily
15-Sep-2009 00:02  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
15-Sep-2009 01:00  FILE /var/spool/cron/root USER root pid 29584 cmd pacman -Sy
15-Sep-2009 01:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
15-Sep-2009 01:01  FILE /var/spool/cron/root USER root pid 29724 cmd /usr/sbin/run-cron /etc/cron.hourly
15-Sep-2009 02:00  FILE /var/spool/cron/root USER root pid 5588 cmd pacman -Sy
15-Sep-2009 02:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
15-Sep-2009 02:01  FILE /var/spool/cron/root USER root pid 5731 cmd /usr/sbin/run-cron /etc/cron.hourly
15-Sep-2009 03:00  FILE /var/spool/cron/root USER root pid 13934 cmd pacman -Sy
15-Sep-2009 03:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
15-Sep-2009 03:01  FILE /var/spool/cron/root USER root pid 14077 cmd /usr/sbin/run-cron /etc/cron.hourly
15-Sep-2009 04:00  FILE /var/spool/cron/root USER root pid 22329 cmd pacman -Sy
15-Sep-2009 04:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
15-Sep-2009 04:01  FILE /var/spool/cron/root USER root pid 22463 cmd /usr/sbin/run-cron /etc/cron.hourly
15-Sep-2009 05:00  FILE /var/spool/cron/root USER root pid 30917 cmd pacman -Sy
15-Sep-2009 05:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
15-Sep-2009 05:01  FILE /var/spool/cron/root USER root pid 31057 cmd /usr/sbin/run-cron /etc/cron.hourly
15-Sep-2009 06:00  FILE /var/spool/cron/root USER root pid 7217 cmd pacman -Sy
15-Sep-2009 06:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
15-Sep-2009 06:01  FILE /var/spool/cron/root USER root pid 7369 cmd /usr/sbin/run-cron /etc/cron.hourly
15-Sep-2009 07:00  FILE /var/spool/cron/root USER root pid 15704 cmd pacman -Sy
15-Sep-2009 07:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
15-Sep-2009 07:01  FILE /var/spool/cron/root USER root pid 15853 cmd /usr/sbin/run-cron /etc/cron.hourly
15-Sep-2009 08:00  FILE /var/spool/cron/root USER root pid 24531 cmd pacman -Sy
15-Sep-2009 08:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
15-Sep-2009 08:01  FILE /var/spool/cron/root USER root pid 24668 cmd /usr/sbin/run-cron /etc/cron.hourly
15-Sep-2009 09:00  FILE /var/spool/cron/root USER root pid 600 cmd pacman -Sy
15-Sep-2009 09:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
15-Sep-2009 09:01  FILE /var/spool/cron/root USER root pid 734 cmd /usr/sbin/run-cron /etc/cron.hourly
15-Sep-2009 10:00  FILE /var/spool/cron/root USER root pid 9376 cmd pacman -Sy
15-Sep-2009 10:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
15-Sep-2009 10:01  FILE /var/spool/cron/root USER root pid 9517 cmd /usr/sbin/run-cron /etc/cron.hourly
15-Sep-2009 11:00  FILE /var/spool/cron/root USER root pid 18141 cmd pacman -Sy
15-Sep-2009 11:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
15-Sep-2009 11:01  FILE /var/spool/cron/root USER root pid 18300 cmd /usr/sbin/run-cron /etc/cron.hourly
15-Sep-2009 12:00  FILE /var/spool/cron/root USER root pid 27232 cmd pacman -Sy
15-Sep-2009 12:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
15-Sep-2009 12:01  FILE /var/spool/cron/root USER root pid 27381 cmd /usr/sbin/run-cron /etc/cron.hourly
15-Sep-2009 13:00  FILE /var/spool/cron/root USER root pid 3772 cmd pacman -Sy
15-Sep-2009 13:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
15-Sep-2009 13:01  FILE /var/spool/cron/root USER root pid 3913 cmd /usr/sbin/run-cron /etc/cron.hourly
15-Sep-2009 14:00  FILE /var/spool/cron/root USER root pid 12270 cmd pacman -Sy
15-Sep-2009 14:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
15-Sep-2009 14:01  FILE /var/spool/cron/root USER root pid 12411 cmd /usr/sbin/run-cron /etc/cron.hourly
15-Sep-2009 15:00  FILE /var/spool/cron/root USER root pid 20925 cmd pacman -Sy
15-Sep-2009 15:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
15-Sep-2009 15:01  FILE /var/spool/cron/root USER root pid 21063 cmd /usr/sbin/run-cron /etc/cron.hourly
15-Sep-2009 16:00  FILE /var/spool/cron/root USER root pid 29606 cmd pacman -Sy
15-Sep-2009 16:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
15-Sep-2009 16:01  FILE /var/spool/cron/root USER root pid 29750 cmd /usr/sbin/run-cron /etc/cron.hourly
15-Sep-2009 17:00  FILE /var/spool/cron/root USER root pid 5996 cmd pacman -Sy
15-Sep-2009 17:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
15-Sep-2009 17:01  FILE /var/spool/cron/root USER root pid 6157 cmd /usr/sbin/run-cron /etc/cron.hourly
15-Sep-2009 18:00  FILE /var/spool/cron/root USER root pid 14779 cmd pacman -Sy
15-Sep-2009 18:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
15-Sep-2009 18:01  FILE /var/spool/cron/root USER root pid 14935 cmd /usr/sbin/run-cron /etc/cron.hourly
15-Sep-2009 19:00  FILE /var/spool/cron/root USER root pid 23745 cmd pacman -Sy
15-Sep-2009 19:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
15-Sep-2009 19:01  FILE /var/spool/cron/root USER root pid 23927 cmd /usr/sbin/run-cron /etc/cron.hourly

I'm not sure why it's not working, I can run rsnapshot from the command line and it creates a backup in the appropriate place sad.

-SMRT

Offline

#2 2009-09-16 03:06:05

neddie_seagoon
Member
Registered: 2009-08-23
Posts: 121

Re: Backups in cron not running

Where is rsnapshot located? Maybe try to add the full path to the crontab line, like:
30 23 * * 0 /path/to/rsnapshot weekly

Offline

#3 2009-09-16 03:22:45

Vladman
Member
Registered: 2009-01-28
Posts: 118

Re: Backups in cron not running

you need a full path for rsnapshot like neddie said plus cron is trying to send an email, so output it to a file like so:

00 00 * * * /usr/bin/rsnapshot sync && rsnapshot daily >> /home/user/bin/errors 2>&1
30 23 * * 0 /usr/bin/rsnapshot weekly >> /home/user/bin/errors 2>&1
00 23 1 * * /usr/bin/rsnapshot monthly >> /home/user/bin/errors 2>&1

Last edited by Vladman (2009-09-16 03:23:09)

Offline

#4 2009-09-17 02:47:20

iamsmrt
Member
Registered: 2009-08-12
Posts: 138

Re: Backups in cron not running

Vladman wrote:

you need a full path for rsnapshot like neddie said plus cron is trying to send an email, so output it to a file like so:

00 00 * * * /usr/bin/rsnapshot sync && rsnapshot daily >> /home/user/bin/errors 2>&1
30 23 * * 0 /usr/bin/rsnapshot weekly >> /home/user/bin/errors 2>&1
00 23 1 * * /usr/bin/rsnapshot monthly >> /home/user/bin/errors 2>&1

I saw that mail business in my log file, what is it?

Offline

#5 2009-09-17 03:12:43

neddie_seagoon
Member
Registered: 2009-08-23
Posts: 121

Re: Backups in cron not running

By default cron will attempt to email your user the output of the programs you tried to run, and in this case it can't, most likely because sendmail or any other MTA is not installed. With Vladman's suggestion you can review the specified file for any errors outputted by the commands cron tried to run.

Offline

#6 2009-09-18 22:16:21

iamsmrt
Member
Registered: 2009-08-12
Posts: 138

Re: Backups in cron not running

Doesn't seem to have worked sad

18-Sep-2009 00:00  FILE /var/spool/cron/root USER root pid 3093 cmd pacman -Sy
18-Sep-2009 00:00  FILE /var/spool/cron/root USER root pid 3094 cmd /usr/bin/rsnapshot sync && /usr/bin/rsnapshot daily >> /home/brian/bin/errors 2>&1
18-Sep-2009 00:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null
18-Sep-2009 00:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null

Offline

#7 2009-09-19 14:53:47

neddie_seagoon
Member
Registered: 2009-08-23
Posts: 121

Re: Backups in cron not running

Did the rsnapshot not run? Do you have a file called /home/brian/bin/errors? It will always give the sendmail error for those commands that aren't redirected like your pacman entry, but you can ignore that.

Offline

#8 2009-09-19 17:51:05

iamsmrt
Member
Registered: 2009-08-12
Posts: 138

Re: Backups in cron not running

Nope, there's no /home/brian/bin/errors file. Would it make the bin folder on its own? Because I don't have one.

Offline

#9 2009-09-19 17:58:30

Vladman
Member
Registered: 2009-01-28
Posts: 118

Re: Backups in cron not running

iamsmrt wrote:

Nope, there's no /home/brian/bin/errors file. Would it make the bin folder on its own? Because I don't have one.

no you need to make it.

Offline

#10 2009-09-21 00:34:40

iamsmrt
Member
Registered: 2009-08-12
Posts: 138

Re: Backups in cron not running

20-Sep-2009 00:00  FILE /var/spool/cron/root USER root pid 7384 cmd /usr/bin/rsnapshot sync && /usr/bin/rsnapshot daily >> /home/brian/cronerrors 2>&1
20-Sep-2009 00:00  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null

Well it didn't output it to a file sad.

EDIT: Same thing happened again, however, this time it created a file but it's blank.

Last edited by iamsmrt (2009-09-21 05:11:06)

Offline

#11 2009-09-21 19:33:05

iamsmrt
Member
Registered: 2009-08-12
Posts: 138

Re: Backups in cron not running

Question: Since I'm doing sudo crontab -e, it's running all processes in the crontab as root, correct?

Offline

#12 2009-09-21 20:05:30

Andrwe
Member
From: Leipzig/Germany
Registered: 2009-06-17
Posts: 322
Website

Re: Backups in cron not running

Yes as you can see in the log ( USER root).

Offline

#13 2009-09-23 05:17:05

iamsmrt
Member
Registered: 2009-08-12
Posts: 138

Re: Backups in cron not running

Good news, rsnapshot sync executed this time but for some reason, rsnapshot daily didn't follow for some reason and I have no idea why sad.

Offline

Board footer

Powered by FluxBB