• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

Simple Script for FTP Files...

mj-barton

Limp Gawd
Joined
Aug 28, 2003
Messages
158
[H]F,

I am automating an FTP routine for moving files from one machine to another. After individual uploads complete the files are deleted from the source machine (limited hd space).

Essentially I want to perform a move function via the FTP protocol that has a md5 checksum feature for verification.

How would you guys tackle this? Nothing turnkey really standouts from my google queries.

You "know":
  • the ftp address,
  • login information
  • destination root path

You do NOT know
  • server side OS
  • the nested folder & file structure of the source directory

Some psuedo code
  • files and folders in a specific directory need to be uploaded to my offsite server
  • each file uploaded must be checksum verfied that upload was successful
  • if successful, delete the file from source machine
  • else delete the file that was originally uploaded
  • move on to next file (to try again later)
 
Last edited:
If you have no access to the destination server, how do you propose to do your checksums?

calculate checksum
upload file
download file
calculate checksum
compare to original.

But if they don't match you don't know why.

In any case, you're going to need to script this. FTP is a very small part of the problem. Python is all the rage these days, though if your source machine is *nix, you can go with a shell script.

welcome to programming.
 
Thanks for the reply, I figured as much. I was curious if this had been done before.
 
If you can get access to the destination server, what you want is rsync.
 
Back
Top