#!/bin/bash
SOURCE_PATH="/path/to/SFTP
DEST_PATH="/path/to/where/
touch $HOME/safe.log
CURRENT_FILES=`cat $SOURCE_PATH`
TMP=""
SAFE=""
for safe_check in $CURRENT_FILES ;
do
TMP=`ps -A | sed 's/ /\n/g' | grep "$safe_check"` ; # list everything active each in a newline, grep for filename
if [ $TMP != "" ]
then
SAFE=$((SAFE + TMP))
else
DATE=`date`
echo "$DATE: $TMP is still being loaded to FTP" >> $HOME/safe.log
fi
for move in $SAFE ; do mv $SOURCE_PATH/$move $DEST_PATH/$move ; done
# you should add this to cronjob, miss typed the /$move in my last post on the last line
Main Topics
Browse All Topics





by: ALEx604Posted on 2005-09-12 at 15:40:59ID: 14868116
#!/bin/bash
/incoming" you/want/t hem"
SOURCE_PATH="/path/to/SFTP
DEST_PATH="/path/to/where/
touch $HOME/safe.log
CURRENT_FILES=`cat $SOURCE_PATH`
TMP=""
SAFE=""
for safe_check in $CURRENT_FILES ;
do
TMP=`ps -A | sed 's/ /\n/g' | grep "$safe_check"` ; # list everything active each in a newline, grep for filename
if [ $TMP != "" ]
then
SAFE=$((SAFE + TMP))
else
DATE=`date`
echo "$DATE: $TMP is still being loaded to FTP" >> $HOME/safe.log
fi
for move in $SAFE ; do
mv $SOURCE_PATH/$move $DEST_PATH/$safe ;
done