Running script creates filename with backslash r at the end


Recommended Posts

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.

Link to comment

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?

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.