Hi all,
So I'm in charge of the IT here at work and last night hit a problem which I've not come across before.
I rsync over ssh from work servers to off-site servers, which usually is fine but occasionally the files are so large that our upload internet speeds cannot handle it and I have to take a copy over to the remote site and sync them up "locally" (it's in a very convenient place so not a problem).
Anyway, I had the issue where I have a source folder in my home directory called:
"subfolder2"
which I wanted to copy in to:
"/directoryA/folder1/folder2/A & B Builders/subfolder"
on the destination server.
My only method was to rsync this over ssh by push method from my local media to the server but it didn't like the ampersand in the destination folder, so it ignored everything after the ampersand and so it wrote everything to a new directory on the destination server called:
"/directoryA/folder1/folder2/A"
The command I used at a bash command prompt was:
Code:
rsync -avh -e "ssh -p 22221" '/home/user1/subfolder2/' 'user@destinationserver:/directoryA/folder1/folder2/A && B Builders/subfolder'
You can see I used a double ampersand, which is what I thought was supposed to be done but it didn't work.
It listed out the files etc at it was sync'ing but it was only by luck that I found where it had sent them.
So, my question is as follows:
Is there a way of Bash not seeing the Ampersand in the file name and thinking it's a command?
I think the term is "escaping out" but I'm not sure and my searching on google hasn't helped me so far.