Mondayuser.admin.fred.tar.gz
which is not correct./bin/sh
# CURL Backup Transfer
# Version 0.1a
# Copyright 2006, Sensson (www.sensson.net)
#
# This script makes it possible to transfer
# backups using your secondary uplink
# like eth1.
ETH=eth0
CURL=/usr/local/bin/curl
result=`$CURL --interface $ETH -T $ftp_local_file -u $ftp_username:$ftp_password ftp://$ftp_ip$ftp_path$ftp_remote_file 2>&1`
if grep -q -o -i "curl: (67) Access denied: 530.*$" <<< "$result"; then
echo "FTP access denied. Please check your login details."
exit 1
fi
if grep -q -o -i "curl: (6) Couldn't resolve host.*$" <<< "$result"; then
echo "Host could not be resolved. Please check your host details."
exit 1
fi
if grep -q -o -i "curl: (9) Uploaded unaligned file size.*$" <<< "$result"; then
echo "File could not be uploaded. Please check your path."
exit 1
fi
if grep -q -o -i "curl: Can't open.*$" <<< "$result"; then
echo "Can't open $ftp_local_file"
exit 1
fi
/bin/sh
/usr/bin/ncftpput -t 25 -m -u "$ftp_username" -p "$ftp_password" "$ftp_ip" "$ftp_path" "$ftp_local_file" 2>&1
RET=$?
exit $RET
/usr/local/bin/php
$use_pasv = true;
$ftp_server = getenv("ftp_ip");
$ftp_user_name = getenv("ftp_username");
$ftp_user_pass = getenv("ftp_password");
$ftp_remote_path = getenv("ftp_path");
$ftp_remote_file = getenv("ftp_remote_file");
$ftp_local_file = getenv("ftp_local_file");
$conn_id = ftp_connect($ftp_server);
if (!$conn_id)
{
echo "Unable to connect to $ftp_servern";
exit(1);
}
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
if (!$login_result)
{
echo "Inavalid login/password for $ftp_user_name on $ftp_server";
ftp_close($conn_id);
exit(2);
}
ftp_pasv($conn_id, $use_pasv);
ftp_mkdir($conn_id, $ftp_remote_path);
if (!ftp_chdir($conn_id, $ftp_remote_path))
{
echo "Invalid remote path '$ftp_remote_path'";
ftp_close($conn_id);
exit(3);
}
if (ftp_put($conn_id, $ftp_remote_file, $ftp_local_file, FTP_BINARY))
{
ftp_close($conn_id);
exit(0);
}
else
{
$use_pasv = false;
ftp_pasv($conn_id, $use_pasv);
if (ftp_put($conn_id, $ftp_remote_file, $ftp_local_file, FTP_BINARY))
{
ftp_close($conn_id);
exit(0);
}
else
{
ftp_close($conn_id);
echo "Error while uploading $ftp_remote_file";
exit(4);
}
}
?>