Skip to content

Commit 4831fe2

Browse files
authored
Correct target for cron
Debian jessie save targets in to /var/spool/cron/crontabs/ Other distros save targets in to /var/spool/cron/
1 parent 2fbdee8 commit 4831fe2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

setup.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,13 @@ cp ./backup.sh "$HOME/bin/backup.sh"
4848
chmod +x "$HOME/bin/backup.sh"
4949
chmod +x ./clearbckp.sh
5050

51+
DIST=$(uname -a | grep -i debian)
52+
if [[ -z "$DIST" ]]; then
5153
# Example target for cron. At 01:00 AM every night.
52-
echo "0 1 * * * $HOME/bin/backup.sh" >> /var/spool/cron/crontabs/root
53-
54+
echo "0 1 * * * $HOME/bin/backup.sh" >> /var/spool/cron/root
55+
else
56+
echo "0 1 * * * $HOME/bin/backup.sh" >> /var/spool/cron/crontabs/root
57+
fi
5458
scp -B ./clearbckp.sh "$REMOTEUSER@$REMOTEHOST:$RPATH"
5559

5660
echo "On the remote computer run:

0 commit comments

Comments
 (0)