Howdy folks,
I have a little predicament with periodic.
I installed rsnapshot to make backups and I start it via periodic(8)
The backup is executed without errors and on time (daily | weekly | monthly).
So far so good...
However, periodic sends me an email after every run with the following content:
As I mentioned, the backups run without a problem.
What am I doing wrong?
Here's a list of all the files involved:
root's crontab:
/usr/local/etc/periodic/monthly/111.rsnapshot:
/usr/local/etc/periodic/weekly/111.rsnapshot
/usr/local/etc/periodic/daily/111.rsnapshot
What am I doing wrong here?
Greetings and thanks in advance!
I have a little predicament with periodic.
I installed rsnapshot to make backups and I start it via periodic(8)
The backup is executed without errors and on time (daily | weekly | monthly).
So far so good...
However, periodic sends me an email after every run with the following content:
Code:
Date: Mon, 08 Jun 2020 02:00:00 +0200
From: Cron Daemon <root@beast.darktemple.ch>
To: root
Subject: Cron <root@beast> root /usr/sbin/periodic daily
/bin/sh: root: not found
As I mentioned, the backups run without a problem.
What am I doing wrong?
Here's a list of all the files involved:
root's crontab:
Bash:
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
0 2 * * * root /usr/sbin/periodic daily
0 3 * * 6 root /usr/sbin/periodic weekly
0 5 1 * * root /usr/sbin/periodic monthly
/usr/local/etc/periodic/monthly/111.rsnapshot:
Bash:
#!/bin/sh -
# NOTE: '-' makes sh a login shell
# /usr/local/etc/periodic/monthly/111.rsnapshot
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
if [ -r /etc/defaults/periodic.conf ]; then
. /etc/defaults/periodic.conf
source_periodic_confs
fi
rc=0
rsnapshot_daily() {
/usr/local/bin/rsnapshot -c /usr/local/etc/rsnapshot.conf daily
return $?
}
rsnapshot_weekly() {
/usr/local/bin/rsnapshot -c /usr/local/etc/rsnapshot.conf weekly
return $?
}
rsnapshot_monthly() {
/usr/local/bin/rsnapshot -c /usr/local/etc/rsnapshot.conf monthly
return $?
}
rsnapshot_monthly
rc=$?
exit $rc
/usr/local/etc/periodic/weekly/111.rsnapshot
Bash:
#!/bin/sh -
# NOTE: '-' makes sh a login shell
# /usr/local/etc/periodic/weekly/111.rsnapshot
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
if [ -r /etc/defaults/periodic.conf ]; then
. /etc/defaults/periodic.conf
source_periodic_confs
fi
rc=0
rsnapshot_daily() {
/usr/local/bin/rsnapshot -c /usr/local/etc/rsnapshot.conf daily
return $?
}
rsnapshot_weekly() {
/usr/local/bin/rsnapshot -c /usr/local/etc/rsnapshot.conf weekly
return $?
}
rsnapshot_monthly() {
/usr/local/bin/rsnapshot -c /usr/local/etc/rsnapshot.conf monthly
return $?
}
rsnapshot_weekly
rc=$?
exit $rc
/usr/local/etc/periodic/daily/111.rsnapshot
Bash:
#!/bin/sh -
# NOTE: '-' makes sh a login shell
# /usr/local/etc/periodic/daily/111.rsnapshot
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
if [ -r /etc/defaults/periodic.conf ]; then
. /etc/defaults/periodic.conf
source_periodic_confs
fi
rc=0
rsnapshot_daily() {
/usr/local/bin/rsnapshot -c /usr/local/etc/rsnapshot.conf daily
return $?
}
rsnapshot_weekly() {
/usr/local/bin/rsnapshot -c /usr/local/etc/rsnapshot.conf weekly
return $?
}
rsnapshot_monthly() {
/usr/local/bin/rsnapshot -c /usr/local/etc/rsnapshot.conf monthly
return $?
}
rsnapshot_daily
rc=$?
exit $rc
What am I doing wrong here?
Greetings and thanks in advance!
