Hi
Attached is a small script that's driving me mad!!
I want to compress a file (using gzip - which I have done), I then want to rename the file using the mv command but add the date and time to the filename from the variables I've declared at the top of the script.
Is there an easy way that I can do this using the mv command or does anyone know of another way? In the script below, it's the second 'mv' line in bold that isn't working.
Thanks in Advance
#!/bin/sh
datestamp=`date +%D" "%T`
epmgrlog=$DBDIR/epmgrlog.log
wepmgr stop
mv $DBDIR/epmgrlog $DBDIR/epmgrlog.log
gzip $epmgrlog
mv $DBDIR/$gzipped $DBDIR/$epmgrlog/$datestamp
wepmgr start
Attached is a small script that's driving me mad!!
I want to compress a file (using gzip - which I have done), I then want to rename the file using the mv command but add the date and time to the filename from the variables I've declared at the top of the script.
Is there an easy way that I can do this using the mv command or does anyone know of another way? In the script below, it's the second 'mv' line in bold that isn't working.
Thanks in Advance
#!/bin/sh
datestamp=`date +%D" "%T`
epmgrlog=$DBDIR/epmgrlog.log
wepmgr stop
mv $DBDIR/epmgrlog $DBDIR/epmgrlog.log
gzip $epmgrlog
mv $DBDIR/$gzipped $DBDIR/$epmgrlog/$datestamp
wepmgr start