jhblzk Posted November 16, 2014 Share Posted November 16, 2014 I am running this script: date > /tmp/rsync.log rsync -ahv --stats --delete --log-format="%t %o %f %l %b" /mnt/user/HomeData/ rsync://192.168.1.132/mnt/user/HomeData >> /tmp/rsync.log date >> /tmp/rsync.log echo "-------------------------------------------------------------------" >> /tmp/rsync.log rsync -ahv --stats --delete --log-format="%t %o %f %l %b" /mnt/user/Media/ rsync://192.168.1.132/mnt/user/Media >> /tmp/rsync.log date >> /tmp/rsync.log echo "-------------------------------------------------------------------" >> /tmp/rsync.log rsync -ahv --stats --delete --log-format="%t %o %f %l %b" /mnt/user/Music/ rsync://192.168.1.132/mnt/user/Music >> /tmp/rsync.log date >> /tmp/rsync.log logger -f /tmp/rsync.log echo "rsync status from `hostname`" | mail -s "rsync stats" -a /tmp/rsync.log root The list line fails with file not found (/tmp/rsync.log). When I do list the /tmp directory, it shows a file named "rsync.log\r". If I attempt to do anything with the file, an error message says there is no such directory or file. I can list it if I use "ls rsync.log?". Does anyone have any idea why there is a special character being added to the end of the file name? I am running unraid 5.0-rc16c. Quote Link to comment
itimpi Posted November 16, 2014 Share Posted November 16, 2014 It sounds as if you created the script using a Windows text editor (which uses CR-LF as end-of-line)? You need to use one which understands Linux/unix end-of-lines (which are just LF). Quote Link to comment
Moussa Posted November 16, 2014 Share Posted November 16, 2014 Yep, what itimpi said. Or you can wrap the file paths in quotes, that should work too. Quote Link to comment
jbartlett Posted November 16, 2014 Share Posted November 16, 2014 Open the file in Notepad, then delete the file. Create the file using VI over Telnet and copy & paste the contents in. Quote Link to comment
jhblzk Posted November 17, 2014 Author Share Posted November 17, 2014 I used VIM on the script and specified "set list" to show special characters. There are no carriage returns, only line feeds ("$") at the end of each line. The script has been in use for several years without modification. The only change I have made recently was to install the latest unmenu version. I use PuTTY on windows to get into root on my unraid server. I tried copying the script from its file on windows to the clipboard, but I could not find any way to paste the text into a VIM session. Any other suggestions? Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.