rsync handler: rotate_short_remote should create $folder.0 on first run
The problem
The rotate_short{,_remote}
functions only rotate the folders, but on the first run they create no initial $folder.0
directory. For this reason after the local rotate_short
function the initial directory is created if it does not exist (which would be the case on first run). However, for the remote target this action is missing.
Suggested solution
The initial directory can be created either in the remote_short_remote
function or in a separate SSH command (seems wasteful). For now I simply put in the rotate_short_remote
function this snippet
# SNIP
if [ ! -d $folder.0 ] ; then
mkdir -p /$folder.0
fi
##### END REMOTE SCRIPT #######
# SNIP
It's up to you whether you want to maintain the rotation functions consistent or not. I would vote for putting the snippet into both rotation functions.
BTW, it would be very helpful to ship a Debian backport package to Jessie with this and other fixes.