~smlavine/navipage

b4bcbfa668f5c2873c4f90315793f9c40ea2842c — Sebastian LaVine 7 months ago 05f7aa9
Use rsync in $NAVIPAGE_SH example
1 files changed, 1 insertions(+), 7 deletions(-)

M navipage.1
M navipage.1 => navipage.1 +1 -7
@@ 113,9 113,6 @@ Execute a command with sh.
.EX
#!/bin/sh
# This is an example of what your $NAVIPAGE_SH could look like.
# Compares the files stored on a server with the files stored locally. Any
# files that are found only once (and are therefore only on the server) are
# formatted into a list and copied with scp.
#
# On my own server, there is a user that runs omnavi on a cronjob every
# morning. A variation on this script is how I get updates on my own machine


@@ 130,10 127,7 @@ Execute a command with sh.
server="user@example.notreal"
serverdir="backups"

( ssh "$server" ls -1 "$serverdir"; ls -1 $NAVIPAGE_DIR )\\
	| sort | uniq -u | sed "s/^/$serverdir\//" | tr '\\n' ' '\\
	| sed 's/^/"/;s/$/"/;'\\
	| xargs -I '{}' scp -T "$server":'{}' "$NAVIPAGE_DIR"
rsync -av "${server}:${serverdir}/" "$NAVIPAGE_DIR"
.EE
.SH INSPIRATION
My original plan with