X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=crontab.d%2Fupdate.sh;h=72422fc90390e3c767eddfacd5fc676045eae484;hb=19420fa802a6d29f6268221894798ba86938a15e;hp=062c34eefb59b393513b18ffa3b7830c7fd68c59;hpb=51075c34517cc53075b4249e985343486d476ce7;p=config%2Fdotfiles.git diff --git a/crontab.d/update.sh b/crontab.d/update.sh index 062c34e..72422fc 100755 --- a/crontab.d/update.sh +++ b/crontab.d/update.sh @@ -50,7 +50,8 @@ echo "###################################" > "$CRONTAB" echo "$HEADER_WARNING" >> "$CRONTAB" echo "###################################" >> "$CRONTAB" echo >> "$CRONTAB" -echo "# It was generated from '$DIRECTORY/*' on `date -R`." >> "$CRONTAB" +printf "# It was generated from '%s/*' on %s." \ + "$DIRECTORY" "`LANG=C date '+%a, %d %b %Y %H:%M:%S %z'`" >>"$CRONTAB" # Enforce C sort order. LC_ALL=C @@ -63,11 +64,9 @@ for file in "$DIRECTORY"/crontab.*; do break fi - echo "Found '$file'." + printf "Found '%s'.\n" "$file" - echo >> "$CRONTAB" - echo >> "$CRONTAB" - echo "## $file:" >> "$CRONTAB" + printf '\n\n## %s:\n' "$file" >>"$CRONTAB" # Strip licenses, multiple empty lines and fix $HOME variables in PATH # (cron doesn't expand variables). @@ -78,6 +77,7 @@ for file in "$DIRECTORY"/crontab.*; do -e "/^# Copyright (C) [0-9][0-9]* / d" \ | cat --squeeze-blank \ | sed "/^PATH/ s:\$HOME:$HOME:g" \ + | sed 's/RAND_SLEEP \([0-9]*\)/sleep `perl -e "srand; print int rand \1;"`/' \ >> "$CRONTAB" done