Hello,
I am new to shell scripting and am having some trouble writing a script that will work the way I want it to. I am good at the one liners, but when I try to string them together I get errors.
I have a ftp server that will trigger shell scripts for uploads. What I have accomplished is basic copys from one server to another file server. What I am trying to do is to create a new directory (on the remote server) named with the current date and time, and copy the new uploaded file to it.
If I run the mkdir part by itself it works fine. I just cant seem to get the file to copy into this newly created directory.
This is what I have tried:
(The words in brackets are the tokens for dir path and filename.)
mkdir /Volumes/Jobs-2008/Incoming_JOBS/`date +%Y-%m-%d-%H-%M`
cp <FILE> /Volumes/Jobs-2008/Incoming_JOBS/`date +%Y-%m-%d`/<FILENAME>
Any pointers would be appreciated
thanks.