Problem with ftp scripts and cron

Need some help / advice with the follow script...

Basically i have an FTP server that connects to other ftp servers and sends and downloads files every few hours or so. There are 12 different accounts that all have 2 scripts each, one to send and one to receive. Below is an example send script for one account. There all the same, just the top variables are changed...

I have put these all in cron to run at certain times but after activating all of them and checking it in the morning it was hanging on connection (ssh)... i managed to get in but was greeted with a number of CRON memory error messages... it seems if the jobs are running into some sort of error they are running again exactly 1min later... how can i stop this???

Any help is appreciated :b:

#!/bin/sh
HOST=***
USER="***"
PASS="***"
ACCOUNT=***
REMOTE_DIRECTORY=***
 
lftp -u ${USER},${PASS} sftp://${HOST} <<EOF
lcd /home/ftp/$ACCOUNT/ftptransfer/outgoing
cd $REMOTE_DIRECTORY
mput *
bye
EOF
 
# Sends title to log file
echo "-------send-------" >> /home/ftp/$ACCOUNT/ftptransfer/log/log.txt
 
# Sends date to log file
date >> /home/ftp/$ACCOUNT/ftptransfer/log/log.txt
# Count how many files are inside outgoing
 
echo "Number of files inside outgoing :" >> /home/ftp/$ACCOUNT/ftptransfer/log/log.txt
 
ls -l /home/ftp/$ACCOUNT/ftptransfer/outgoing | grep ^- | wc -l >> /home/ftp/$ACCOUNT/ftptransfer/log/log.txt
 
# List the files that have just been sent
echo "List of files that have just been sent :" >> /home/ftp/$ACCOUNT/ftptransfer/log/log.txt
ls /home/ftp/$ACCOUNT/ftptransfer/outgoing >> /home/ftp/$ACCOUNT/ftptransfer/log/log.txt
 
# Moves the files from outgoing to archived
mv /home/ftp/$ACCOUNT/ftptransfer/outgoing/* /home/ftp/$ACCOUNT/ftptransfer/archived
 
# Counts how many files are inside archived
echo "Number of files inside archived :" >> /home/ftp/$ACCOUNT/ftptransfer/log/log.txt
ls -l /home/ftp/$ACCOUNT/ftptransfer/archived | grep ^- | wc -l >> /home/ftp/$ACCOUNT/ftptransfer/log/log.txt
 
# Line break to log file
echo "" >> /home/ftp/$ACCOUNT/ftptransfer/log/log.txt

---------- Post updated at 04:39 AM ---------- Previous update was at 04:33 AM ----------

[/COLOR]The error message is along the lines of (sorry i forgot most of it)

out of memory kill process cron score

Seems your script is not the reason directly - I would check the free memory of your box, patch level etc. to make sure it isn't be caused because of a bug/memory leak or something like that.
Check the error log of your Unix/Linux too maybe.