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 done
chown -R user /home/user/.ssh chown -R user /home/user/.ssh
# load cron # load crontab for root
CRONFILE=`mktemp` crontab <<EOF
cat > $CRONFILE <<EOF
* * * * * /usr/local/sbin/reprepro-import >> /var/log/reprepro.log * * * * * /usr/local/sbin/reprepro-import >> /var/log/reprepro.log
EOF EOF
crontab -u root $CRONFILE
rm -f $CRONFILE
# run import once, to create the right directory structure # run import once, to create the right directory structure
/usr/local/sbin/reprepro-import /usr/local/sbin/reprepro-import