More information about the Underscore mailing list

[_] OS X SSH -p Help

Ryan Maunder ryan at itech-net.co.uk
Mon Jul 2 14:10:45 BST 2012

Excellent! Works like a charm.

Thanks Daniel.


NB - You have to quote the destination directory as it seems rsync  
ignores backslashing for invoking spaces without it.

Final script as follows for anyone who is interested


#Server Backup

echo -e "Server Backup\n\n" > /var/log/rsync/backuprsync.log

echo START: Backup Started on `date "+%m/%d/%y %l:%M:%S %p"` >> /var/ 
log/rsync/backuprsync.log

export SSH_AUTH_SOCK=$( ls -t /tmp/launch-*/Listeners | head -1)

rsync -avuz --delete --ignore-errors --stats --exclude=/.Spotlight- 
V100 --rsh="ssh -p2222" /Source\ Folder user at ipaddress:'/Destination\  
Folder' >> /var/log/rsync/backuprsync.log

echo -e "\n\n END: Backup Complete on `date "+%m/%d/%y %l:%M:%S %p"`"  
 >> /var/log/rsync/backuprsync.log





Ryan Maunder


On 2 Jul 2012, at 13:54, Daniel Craig wrote:

> The difference is quoting the -e argument -e "ssh -p 2222". rsync -p
> will preserve permissions and then it'll try to upload the file  
> 2222 ...
> not what is intended.
>
> On Mon, 2012-07-02 at 13:42 +0100, Ryan Maunder wrote:
>> Thanks Daniel - I think I can use some of that syntax to make it  
>> work!
>>
>> Cheers
>>
>>
>>
>>
>> Ryan Maunder
>>
>>
>> On 2 Jul 2012, at 13:14, Daniel Craig wrote:
>>
>>> Is this what you are after:
>>> http://www.linuxquestions.org/questions/linux-software-2/rsync-ssh-on-different-port-448112/
>>>
>>> On Mon, 2012-07-02 at 13:02 +0100, Ryan Maunder wrote:
>>>> Hi underscore
>>>>
>>>> Was after a bit of SSH help if poss.
>>>>
>>>>
>>>> Have got password cached SSH Server* running nicely on an OS X box
>>>> (Box1 for simplicity's sake)
>>>>
>>>> * (launchd very kindly asks you if you want to store it in the
>>>> keychain - very handy for remote SSH rsync backups)
>>>>
>>>>
>>>> I am running another different SSH Server (Also OS X - lets call it
>>>> box 2) on the same WAN IP using a different port using the -p  
>>>> switch
>>>> (ssh -p someport whoever at ipaddress)
>>>> Logging into box 2 from a client manually, via Terminal brings up  
>>>> the
>>>> key cache perfectly fine and it stores it nicely however, when
>>>> running
>>>> a compiled script from the client, it tries to log into box 1. How
>>>> can
>>>> I pass the -p switch in the script to enable the client to log into
>>>> box 2?
>>>>
>>>>
>>>> Compiled script as follows
>>>>
>>>>
>>>> #Server Backup
>>>>
>>>> echo -e "Server Backup\n\n" > /var/log/rsync/backuprsync.log
>>>>
>>>> echo START: Backup Started on `date "+%m/%d/%y %l:%M:%S %p"` >> / 
>>>> var/
>>>> log/rsync/backuprsync.log
>>>>
>>>> export SSH_AUTH_SOCK=$( ls -t /tmp/launch-*/Listeners | head -1)
>>>>
>>>> rsync -avuz --delete --ignore-errors --stats --exclude=/.Spotlight-
>>>> V100 -e ssh -p 2222 /Source/ root at myipaddress:'/Destination' >> / 
>>>> var/
>>>> log/rsync/backuprsync.log
>>>>
>>>> echo -e "\n\n END: Backup Complete on `date "+%m/%d/%y %l:%M:%S  
>>>> %p"`"
>>>>>> /var/log/rsync/backuprsync.log
>>>>
>>>>
>>>> Many thanks
>>>>
>>>>
>>>> Ryan Maunder
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> -- 
>>> underscore_ list info/archive -> http://www.under-score.org.uk/mailman/listinfo/underscore
>>
>>
>
>
>
> -- 
> underscore_ list info/archive -> http://www.under-score.org.uk/mailman/listinfo/underscore