shithub: rc

ref: 4028a0b5f197066ef36281f45c8efbaaaf3dbe37
dir: /bin/syncbv91/

View raw version
#!/bin/rc -e
rfork n
if(! ~ $#* 1){
	echo usage: $0 sys
	exit usage
}
if(! sshfs tcp!$1!8022){
	echo ssh failed: $status
	exit ssh
}
# sd card mtimes are full of lies
if(~ $1 bv91){
	cd /lib/m
	for(i in m*){
		if(! test -d /n/ssh/m)
			ssh tcp!bv91!8022 ln -s storage/external-1/m m || exit
		if(! test -d /n/ssh/m/$i)
			clone -T $i /n/ssh/m/
		if not
			syncab -m $i /n/ssh/m/$i | tee -a /tmp/sync.$pid
	}
}
syncab $home/lib/i /n/ssh/Pictures | tee -a /tmp/sync.$pid
echo proceed?
if(! ~ `{read} yes){
	echo exiting
	exit nope
}
. /tmp/sync.$pid && rm /tmp/sync.$pid