Skip to content

Commit

Permalink
Fix crontab formattring (#133)
Browse files Browse the repository at this point in the history
The previous crontab syntax had a few issues:
- The quotes end up being mixed, change quotes to single quotes to make
  managing easier
- Percent has to be escaped, unescaped % is treated as newline and rest
  of the content is passed in stdin to the command
  • Loading branch information
ressu authored Nov 11, 2024
1 parent 35a26f1 commit 95fb874
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ install_cron() {
loading_pid=$!
(
crontab -l 2>/dev/null
echo "0 */4 * * * $HOME/klipper-backup/script.sh -c \"Cron backup - \$(date +\"%x - %X\")\""
echo "0 */4 * * * $HOME/klipper-backup/script.sh -c \"Cron backup - \$(date +'\\%x - \\%X')\""
) | crontab -
sleep .5
kill $loading_pid
Expand Down

0 comments on commit 95fb874

Please sign in to comment.