Need to find a way to upload files to my server through FTP. But only the ones that have been modified. Is there a simple way of doing that? Command line ftp client or script is preferred. Thanks, Jonas.
To upload file on FTP server use put command from FTP prompt.
You can use an FTP client to create and edit files for your website. This is an easier way to create and edit files compared to using the command line.
Use the Multiple Put ( mput ) command with the wildcard character ( * ) to upload multiple files. Some FTP clients require you to manually acknowledge each file name when executing the mput command. This makes automating FTP scripts difficult because it requires you to be present when the script is executed.
The most reliable way would be to make md5 hashes of all the local files you care about and store it in a file. So the file will contain a list of filenames and their md5 hashes. Store that file on your ftp server. When you want to update the files on your ftp server, download the file containing the list, compare that against all your local files, and upload the files that have changed (or are new). That way you don't have to worry about archive bits, modified date, or looking at file sizes, the use of which can never be 100% reliable.
Using file sizes isn't reliable for the obvious reason - a file could change but have the same size. I'm not a fan of using the archive bit or modified date because either of those could be confused if you backup or restore your local directory with another backup program.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With