Move Script

Hi
I am very new to scripts and only have a basic knowledge
What i am trying to do is move files from one directory to another, but i need to make sure the file is stable before it moves the file to the destination. Here is the script that i am using that is moving the files, it part of a script another company used and i am trying to hack it around to suit. Any help would be appreciated and if there is a better way to do it please say so

#!/bin/sh

SOURCE_DIR=/appcfg/COLOURSERVE/OUT
BACKUP_DIR=/symlnks/io/jobs/workflows/TAG-461/Conde_Nast_Output
cd $SOURCE_DIR
mv -f * $BACKUP_DIR/

Define 'file is stable' --

the destination folder is a hotfolder linked to a software program that has to process the file. So i need to ensure that the file has completed the copy to the destination
thanks

maybe use ls -l to compare the exact sizes of both files, or even something like md5 of both source and end copies, if I understood you correctly.

is there a command you can add to the script that checks if the file has finished growing in size?

you can check it by adding something like "echo test test" in the next line after mv or cp, the echo command will only be executed when cp or mv is complete, that means when the file doesn't grow in the size any more.

so it will read

#!/bin/sh

SOURCE_DIR=/appcfg/COLOURSERVE/OUT
BACKUP_DIR=/symlnks/io/jobs/workflows/TAG-461/Conde_Nast_Output
cd $SOURCE_DIR
mv -f * $BACKUP_DIR/
"echo test test"

but how does it know the file name do you not have to use a wild card?
sorry very limited experince with scripts

By the way, try that one:

#!/bin/sh
SOURCE=/appcfg/COLOURSERVE/OUT
DESTINATION=/symlnks/io/jobs/workflows/TAG-461/Conde_Nast_Output
cp -r $SOURCE/* $DESTINATION/
echo Done.

It copies all files from the source directorye to the destination ( your script moved them - not so good) and when the job is done the script reports "Done."

thanks will give it a go