Jump to content

Running script creates filename with backslash r at the end


jhblzk

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...