nc-rsync: choose ssh port other than 22 (#564) (#793)

This commit is contained in:
Daniel Röhrig 2019-02-06 01:20:11 +01:00 committed by nachoparker
parent 4edbae169b
commit 8f84daf690
4 changed files with 14 additions and 2 deletions

View File

@ -34,7 +34,7 @@ configure()
${SSH[@]} : || { echo "SSH non-interactive not properly configured"; return 1; }
}
echo "0 5 */${SYNCDAYS} * * root /usr/bin/rsync -ax --delete \"$DATADIR\" \"$DESTINATION\"" > /etc/cron.d/ncp-rsync-auto
echo "0 5 */${SYNCDAYS} * * root /usr/bin/rsync -ax -e \"ssh -p $PORTNUMBER\" --delete \"$DATADIR\" \"$DESTINATION\"" > /etc/cron.d/ncp-rsync-auto
chmod 644 /etc/cron.d/ncp-rsync-auto
service cron restart

View File

@ -26,7 +26,7 @@ configure()
return 1;
}
rsync -ax --delete "$DATADIR" "$DESTINATION"
rsync -ax -e "ssh -p $PORTNUMBER" --delete "$DATADIR" "$DESTINATION"
sudo -u www-data php "$BASEDIR"/nextcloud/occ maintenance:mode --off
}

View File

@ -18,6 +18,12 @@
"value": "user@ip:/path/to/sync",
"suggest": "user@ip:/path/to/sync"
},
{
"id": "PORTNUMBER",
"name": "SSH port number",
"value": "22",
"suggest": "22"
},
{
"id": "SYNCDAYS",
"name": "Sync days",

View File

@ -11,6 +11,12 @@
"name": "Destination",
"value": "user@ip:/path/to/sync",
"suggest": "user@ip:/path/to/sync"
},
{
"id": "PORTNUMBER",
"name": "SSH port number",
"value": "22",
"suggest": "22"
}
]
}