My Opera is closing 1st of March

M.I.T = Multimedia IT dept.

Subscribe to RSS feed

bash script for ftpsync

,

#!/bin/bash
# checkftpsync.sh: cron script for checking ftpsync.pl instance
#===========================================
SYNCLOG=/myfolder/SYNC.log
a=`ps -A|grep 'ftpsync.pl'`
if [ -z "$a" ];then
echo "`date`: Starting new ftpsync..." >> $SYNCLOG
./ftpsync.sh
else
echo "`date`: ftpsync continue running!!" >> $SYNCLOG
fi
#===============================================================

#!/bin/bash
# ftpsync.sh: script to fireup ftpsync.pl
# Last modified: Feb 6, 2010
# Get FOOTAGE only...
killall ftpsync.pl
BINPATH=/usr/local/sbin
REMOTETIME="-12 hours"
SERVER=remote.server
USER=myuser
PSWD=mypassword
GETDIR2=/remotepath/`date -d "$REMOTETIME" +%Y%m`/`date -d "$REMOTETIME" +%d`/FOOTAGE/
PUTDIR2=/mypath/`date -d "$REMOTETIME" +%Y%m`/`date -d "$REMOTETIME" +%d`/FOOTAGE/
LOGFILE=/logpath/$SERVER-`date -d "$REMOTETIME" +%Y%m%d`.log
ERRLOG=/logpath/DEBUG
# Fireup ftpsync.pl !!
mkdir -p $PUTDIR2
$BINPATH/ftpsync.pl -dgv ftpserver=$SERVER ftpdir=$GETDIR2 ftpuser=$USER ftppasswd=$PSWD $PUTDIR2 > $LOGFILE 2> $ERRLOG
February 2014
M T W T F S S
January 2014March 2014
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28