Skip to content

Commit 99dcdb2

Browse files
authored
Merge pull request hestiacp#1943 from clarkchentw/patch-1
Fix possible error occur for v-rebuild-cron-jobs
2 parents 0675980 + 33e266f commit 99dcdb2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

func/main.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ sync_cron_jobs() {
610610
else
611611
crontab="/var/spool/cron/$user"
612612
fi
613-
rm -f $crontab
613+
>$crontab
614614
if [ "$CRON_REPORTS" = 'yes' ]; then
615615
echo "MAILTO=$CONTACT" > $crontab
616616
echo 'CONTENT_TYPE="text/plain; charset=utf-8"' >> $crontab
@@ -1304,4 +1304,4 @@ no_symlink_chmod() {
13041304

13051305
chmod "${filemode}" "${i}"
13061306
done
1307-
}
1307+
}

0 commit comments

Comments
 (0)