fix: do not use append mode while editing cron jobs.

This commit is contained in:
Sameer Naik 2014-02-26 09:38:13 +05:30
parent 95179fbe6e
commit 301e2326db

View File

@ -259,22 +259,17 @@ gitlab_start () {
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
# setup cron job for automatic backups
set +e
crontab -l -u git > /tmp/cron.git
set -e
case "${GITLAB_BACKUPS}" in
daily)
cat >> /tmp/cron.git <<EOF
sudo -u git -H cat > /tmp/cron.git <<EOF
00 02 * * * cd /home/git/gitlab && PATH=/usr/local/bin:/usr/bin:/bin bundle exec rake gitlab:backup:create RAILS_ENV=production
EOF
;;
monthly)
cat >> /tmp/cron.git <<EOF
sudo -u git -H cat > /tmp/cron.git <<EOF
00 02 01 * * cd /home/git/gitlab && PATH=/usr/local/bin:/usr/bin:/bin bundle exec rake gitlab:backup:create RAILS_ENV=production
EOF
;;
disable|*)
;;
esac
crontab -u git /tmp/cron.git && rm -rf /tmp/cron.git