Help with command

Pfd27

New Member
Joined
Jan 27, 2021
Messages
8
Reaction score
0
Credits
65
I am trying to write a script to backup a folder to my server, but I'm making a error in the rsync command somewhere.

I'm able to do what I want in grsync, but when I use the command that grsync gives me I get a error.
The command I'm using is below

"rsync -r -t -v --progress -s /home/rob/.local/share/American Truck Simulator 192.168.1.61:/media/Spare/Lenny/test /"

The error I get is

"Unexpected remote arg: 192.168.1.61:/media/Spare/Lenny/test
rsync error: syntax or usage error (code 1) at main.c(1496) [sender=3.2.3]"

I'm thinking it has something to do with the spaces in the folder name, but I'm unable to figure it out.

Any help would be great
 


UnixSH

New Member
Joined
Jan 27, 2021
Messages
14
Reaction score
2
Credits
82
Hey, yes it's a name problem : the command take too much arguments.

Try this :
Code:
rsync -r -t -v --progress --protect-args -s "/home/rob/.local/share/American Truck Simulator" 192.168.1.61:/media/Spare/Lenny/test /
If I don’t make a mistake, it should works.
 
OP
P

Pfd27

New Member
Joined
Jan 27, 2021
Messages
8
Reaction score
0
Credits
65
Thanks. I tried it and got this error
Unexpected remote arg: 192.168.1.61:/media/Spare/Lenny/test
rsync error: syntax or usage error (code 1) at main.c(1496) [sender=3.2.3]
 
OP
P

Pfd27

New Member
Joined
Jan 27, 2021
Messages
8
Reaction score
0
Credits
65
I have tried adding the user and got the same error.
I have "rsync -r -t -v --progress --delete -s /home/rob/Stuff/ 192.168.1.61:/media/Storage/Lenny/Stuff/"
In the same script and this command works fine. Thats why I thought the problem was because of the spaces in the folder name
 

UnixSH

New Member
Joined
Jan 27, 2021
Messages
14
Reaction score
2
Credits
82
OK, let's try this :

Code:
rsync -r -t -v --progress -s '/home/rob/.local/share/American\ Truck\ Simulator' 192.168.1.61:/media/Spare/Lenny/test /
 
OP
P

Pfd27

New Member
Joined
Jan 27, 2021
Messages
8
Reaction score
0
Credits
65
[email protected]:~$ rsync -r -t -v --progress -s '/home/rob/.local/share/American\ Truck\ Simulator' 192.168.1.61:/media/Spare
/Lenny/test /
Unexpected remote arg: 192.168.1.61:/media/Spare/Lenny/test
rsync error: syntax or usage error (code 1) at main.c(1496) [sender=3.2.3]
 

UnixSH

New Member
Joined
Jan 27, 2021
Messages
14
Reaction score
2
Credits
82
The command is not supposed to work without an user with your IP if it's a remote host... and remove the space at the end, after "/test"
 
OP
P

Pfd27

New Member
Joined
Jan 27, 2021
Messages
8
Reaction score
0
Credits
65
Strange. The command "rsync -r -t -v --progress --delete -s /home/rob/Stuff/ 192.168.1.61:/media/Storage/Lenny/Stuff/" Works fine in another script. I'll have to keep working on it. Thanks for your help
 
OP
P

Pfd27

New Member
Joined
Jan 27, 2021
Messages
8
Reaction score
0
Credits
65
Does more than it has :)

rsync -r -t -v --progress -s /home/rob/.local/share/American Truck Simulator 192.168.1.61:/media/Spare/Lenny/test/
sending incremental file list
rsync: [sender] link_stat "/home/rob/.local/share/American" failed: No such file or directory (2)
rsync: [sender] link_stat "/home/rob/Truck" failed: No such file or directory (2)
rsync: [sender] link_stat "/home/rob/Simulator" failed: No such file or directory (2)

sent 18 bytes received 12 bytes 12.00 bytes/sec
total size is 0 speedup is 0.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1330) [sender=3.2.3]
 

UnixSH

New Member
Joined
Jan 27, 2021
Messages
14
Reaction score
2
Credits
82
OK. So try this ;) :
Code:
rsync -r -t -v --progress -s '/home/rob/.local/share/American\ Truck\ Simulator' 192.168.1.61:/media/Spare/Lenny/test
 
OP
P

Pfd27

New Member
Joined
Jan 27, 2021
Messages
8
Reaction score
0
Credits
65
I just tried adding the backslashes seconds before you posted this. It's running the backup as I'm typing
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Members online


Top