Avatar of Member_2_6492660_1
Member_2_6492660_1
Flag for United States of America

asked on 

MV --suffix Not Working

Ubuntu 16.04.1

I run Nagios on this server.

I have a directory that contains .cfg files

I would like to move those .cfg files to and archive directory  

Tying to use the mv command and add a suffix to the end of the files.

#!/bin/sh

today=$(date +%Y-%m-%d)


mv -v -b --suffix=.'today'-TG *.cfg archive

Open in new window


 root@tgcs017:/usr/local/nagios/etc/objects/desktops# ./update.sh
'TGKW001.cfg' -> 'archive/TGKW001.cfg'
'TGKW003.cfg' -> 'archive/TGKW003.cfg'
'TGKW004.cfg' -> 'archive/TGKW004.cfg'
'TGKW005.cfg' -> 'archive/TGKW005.cfg'
'TGKW006.cfg' -> 'archive/TGKW006.cfg'
'TGKW007-10.cfg' -> 'archive/TGKW007-10.cfg'
'TGKW008-10.cfg' -> 'archive/TGKW008-10.cfg'
'TGKW009.cfg' -> 'archive/TGKW009.cfg'
'TGKW012.cfg' -> 'archive/TGKW012.cfg'

the script is simple and it runs it moves the files but never adds the suffix.

Any ideas?

Thank you
Linux

Avatar of undefined
Last Comment
noci

8/22/2022 - Mon