Set the crontab directly

Saves a temporary file when the HERE-document is already a temp file.
This commit is contained in:
Nick Andrew 2014-11-16 23:44:19 +11:00
parent fce7331e56
commit 082b56789e

View file

@ -25,13 +25,10 @@ for key in /docker/keys/*.pub ; do
done
chown -R user /home/user/.ssh
# load cron
CRONFILE=`mktemp`
cat > $CRONFILE <<EOF
# load crontab for root
crontab <<EOF
* * * * * /usr/local/sbin/reprepro-import >> /var/log/reprepro.log
EOF
crontab -u root $CRONFILE
rm -f $CRONFILE
# run import once, to create the right directory structure
/usr/local/sbin/reprepro-import