Compare commits
	
		
			2 commits
		
	
	
		
			85147a4fd6
			...
			2e16c5e914
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 2e16c5e914 | |||
| cfa41acafc | 
					 2 changed files with 11 additions and 7 deletions
				
			
		| 
						 | 
					@ -58,9 +58,8 @@ let
 | 
				
			||||||
      mosh
 | 
					      mosh
 | 
				
			||||||
      openssh
 | 
					      openssh
 | 
				
			||||||
      sshfs-fuse
 | 
					      sshfs-fuse
 | 
				
			||||||
      cryfs
 | 
					 | 
				
			||||||
      openssh
 | 
					 | 
				
			||||||
      sshuttle
 | 
					      sshuttle
 | 
				
			||||||
 | 
					      cryfs
 | 
				
			||||||
      thefuck
 | 
					      thefuck
 | 
				
			||||||
      gnupg
 | 
					      gnupg
 | 
				
			||||||
      unar
 | 
					      unar
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -29,7 +29,7 @@
 | 
				
			||||||
  				JUMPHOST="$DEFAULT_JUMPHOST"
 | 
					  				JUMPHOST="$DEFAULT_JUMPHOST"
 | 
				
			||||||
  				;;
 | 
					  				;;
 | 
				
			||||||
  			?)
 | 
					  			?)
 | 
				
			||||||
  				echo "rsyncrepo [-J] [-j <jumphost>] <directory> <hostname>"
 | 
					  				echo "rsyncrepo [-J] [-j <jumphost>] <directory> <hostname> [target dir name]"
 | 
				
			||||||
  				return 1
 | 
					  				return 1
 | 
				
			||||||
  				;;
 | 
					  				;;
 | 
				
			||||||
  		esac
 | 
					  		esac
 | 
				
			||||||
| 
						 | 
					@ -40,6 +40,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  	RR_FROM="$1"
 | 
					  	RR_FROM="$1"
 | 
				
			||||||
  	RR_TO="$2"
 | 
					  	RR_TO="$2"
 | 
				
			||||||
 | 
					    RR_TARGET="$3"
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  _do_rsync() {
 | 
					  _do_rsync() {
 | 
				
			||||||
| 
						 | 
					@ -57,8 +58,12 @@
 | 
				
			||||||
  		echo "$OPTI"
 | 
					  		echo "$OPTI"
 | 
				
			||||||
  	done
 | 
					  	done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  	# we always sync /path/to/dir/ to hostname:dir
 | 
					  	# If no $3 is specified, we sync /path/to/dir/ to hostname:dir
 | 
				
			||||||
  	RR_DEST="''${2}:$(basename $(realpath "''${1}"))"
 | 
					    if [ -z "$3" ]; then
 | 
				
			||||||
 | 
					      RR_DEST="''${2}:$(basename $(realpath "''${1}"))"
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					      RR_DEST="''${2}:''${3}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  	echo "Syncing ''${1} to ''${RR_DEST}…"
 | 
					  	echo "Syncing ''${1} to ''${RR_DEST}…"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -69,11 +74,11 @@
 | 
				
			||||||
  rsyncrepo() {
 | 
					  rsyncrepo() {
 | 
				
			||||||
  	_parse_rsync_args "$@"
 | 
					  	_parse_rsync_args "$@"
 | 
				
			||||||
  	# inherits parsed arguments through variables
 | 
					  	# inherits parsed arguments through variables
 | 
				
			||||||
  	_do_rsync "$RR_FROM" "$RR_TO"
 | 
					  	_do_rsync "$RR_FROM" "$RR_TO" "$RR_TARGET"
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  rsynchydra() {
 | 
					  rsynchydra() {
 | 
				
			||||||
  	_parse_rsync_args "$@"
 | 
					  	_parse_rsync_args "$@"
 | 
				
			||||||
  	_do_rsync "$RR_FROM" "hydra01"
 | 
					  	_do_rsync "$RR_FROM" "hydra01" "$RR_TARGET"
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
''
 | 
					''
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue