laurent22 / rsync-time-backup

Time Machine style backup with rsync.
3.36k stars 443 forks source link

fix: Quote `$0` and printed variable #263

Closed hyperupcall closed 8 months ago

hyperupcall commented 8 months ago

This addresses some low-hanging fruit mentioned in #89.

The basename $0 is always a fix. If the path to the script contained spaces, then anything after the space will be considered a prefix (removing parts of the path), which would later make the ps -axp "$RUNNINGPID" -o "command" | grep "$APPNAME" > /dev/null result in false positives.

In the case of echo $RSYNC_FLAGS, it is the last thing run, and it does not change what is printed, which is a convenience to the user.

laurent22 commented 8 months ago

Looks good, thanks!