0

I'm fairly new to Linux & am starting to use rsync as my sync tool.

I have a command line that's working well for me:

rsync -havz --progress --stats  --delete --exclude '*.log' --log-file=/backup/_logs/$(date +%Y%m%d)_rsync.log root@192.168.0.100:/home/ /backup/360soaa2/

But, when I try to add put this in a bash script, the destination folder (360soaa2) isn't working. I get a message in rsync saying:

created directory /backup/360soaa2/\#015

And a folder is created within /backup/360soaa2/

What am I doing wrong?

Thanks

JezB
  • 528
  • 1
  • 10
  • 26
  • `015` is octal for `0x0D`, the carriage return character. Do not edit your shell scripts on Windows, or use `dos2unix` to repair the damage. – Frédéric Hamidi Feb 16 '16 at 15:51
  • @FrédéricHamidi can you make this an answer so I can accept it please? – JezB Feb 16 '16 at 16:01
  • I won't answer because there are lots of duplicates around. I suggest [How to convert Windows end of line in Unix end of line (CR/LF to LF)](http://stackoverflow.com/q/3891076/464709). – Frédéric Hamidi Feb 16 '16 at 16:02

1 Answers1

0

I created the bash script in Notepad++ (Windows) - this, as Frédéric Hamidi pointed out, caused the issue. Edited in Nano & all working as expected. Thanks Frédéric!

JezB
  • 528
  • 1
  • 10
  • 26