To achieve the task with ssh and scp (instead of rsync): lets break the task into 2 steps:
1. Create directory if missing:
ssh user@ftpserver.com "mkdir -p /data/install/somefolder"
2. Copy to it:
scp -r /data/install/somefolder user@ftpserver.com:/data/install/somefolder
Put them together
server="user@ftpserver.com"
destiny="/data/install/somefolder"
src="/data/install/somefolder"
ssh "$server" "mkdir -p $destiny" && scp -r "$src" "$server:$destiny"
Related Contents:
- Looping through the content of a file in Bash
- How to kill all processes with a given partial name? [closed]
- Aborting a shell script if any command returns a non-zero value
- How can I kill a process by name instead of PID, on Linux? [duplicate]
- [ :Unexpected operator in shell programming [duplicate]
- How to concatenate multiple lines of output to one line?
- How to determine if a process runs inside lxc/Docker?
- How to loop over directories in Linux?
- Execute bash script from URL
- Command not found when using sudo
- Exclude .svn directories from grep [duplicate]
- How can I do division with variables in a Linux shell?
- How to handle more than 10 parameters in shell
- Identify user in a Bash script called by sudo
- Redirect all output to file using Bash on Linux? [duplicate]
- Asynchronous shell commands
- Forcing bash to expand variables in a string loaded from a file
- How to hide wget output in Linux? [closed]
- How to get the difference (only additions) between two files in linux
- Indenting multi-line output in a shell script
- Find multiple files and rename them in Linux
- How to execute a remote command over ssh with arguments?
- Insert multiple lines into a file after specified pattern using shell script
- How to use variables in a bash for loop [duplicate]
- How to find file accessed/created just few minutes ago
- SSH from A through B to C, using private key on B [closed]
- GNU less: How can I search while ignoring case sensitivity without using less -I option?
- Bash Loop – How to stop the loop when I press Control-C inside a command?
- Determine if filesystem or partition is mounted RO or RW via Bash Script?
- Run command in bash without save in history
- Make ls print it all on one line (like in terminal)
- Is there a utility like cron, that schedules a job for later (but only once)?
- Compress command output by piping to bzip2
- How do I recall a specific command from command history, without executing it
- Starting a script as another user
- What is the difference between “sudo -i” and “sudo bash -l”
- How can I count the number of characters in a Bash variable [duplicate]
- How to highlight Bash scripts in Vim?
- in linux terminal, how do I show the folder’s last modification date, taking its content into consideration?
- Linux Terminal: typing feedback gone, line breaks not displayed
- Recursively cat all the files into single file
- How do you kill all Linux processes that are older than a certain age?
- Linux: Find all symlinks of a given ‘original’ file? (reverse ‘readlink’)
- grep from tar.gz without extracting [faster one]
- Rename files and directories recursively under ubuntu /bash
- wget: don’t follow redirects
- What does 2 commas after variable name mean in bash?
- How to split a list by comma not space
- Gzip with all cores
- Using Bash Script to Find Line Number of String in File