I am having problems with scp during a backup operation
I added a ps -ef before and after the scp operation used during the backup.
The backup is a script to backup a Zimbra Server
I am including the code segment that I am having problems
Code:
# DRCP Section. To scp newly created archives to a remote system
if [ "$DRCP" = "yes" ]
then
echo ""
ps -ef
echo ""
CPNAME=`ls -A "$ARCHIVENAME"*`
SCPRC=0
echo "copy archive to $REMOTEHOST" remote directory $REMOTEDIR
if [ "$SSHKEY" = "rsa" ]
then
scp -i /root/.ssh/id_rsa $CPNAME "$SSHUSER"@"$REMOTEHOST":"$REMOTEDIR"
SCPRC=$?
elif [ "$SSHKEY" = "dsa" ]
then
scp -i /root/.ssh/id_dsa $CPNAME "$SSHUSER"@"$REMOTEHOST":"$REMOTEDIR"
SCPRC=$?
elif [ "$SSHKEY" = "rsa1" ]
then
scp -i /root/.ssh/identity $CPNAME "$SSHUSER"@"$REMOTEHOST":"$REMOTEDIR"
SCPRC=$?
fi
echo ""
ps -ef
echo ""
if [ "$SCPRC" -ne "0" ]
then
echo "Error copying archive and checksum to $REMOTEHOST"
mail_log
exit 1
elif [ $TYPE = "full" ]
then
echo "$ARCHIVENAME"
echo "ssh $SSHUSER@$REMOTEHOST" "rm -f $REMOTEDIR/$LAST_FULL_WEEK_$BACKUPNAME*"
ssh "$SSHUSER"@"$REMOTEHOST" rm -f "$REMOTEDIR"/"$LAST_FULL_WEEK"_"$BACKUPNAME"*
fi
fi
I am including the log that is sent during the backup by email as attachment since is too long
How can I see which process is locking the file that is being truncated?