Trying to find an easy way to upload only modified files via FTP

You need to find a way to upload files to my server via FTP. But only those that have been changed. Is there an easy way to do this? The ftp or script command line client is preferred. Thanks, Jonas.

+4
source share
9 answers

The most reliable way is to make the md5 hashes of all the local files you need and save them in a file. Thus, the file will contain a list of file names and their md5 hashes. Save this file on your ftp server. If you want to update files on your ftp server, upload the file containing the list, compare it with all your local files and upload files that have been changed (or are new). Thus, you do not need to worry about archive bits, changing the date or viewing file sizes, the use of which can never be 100% reliable.

Using file sizes is unreliable for the obvious reason - the file may change, but be the same size. I am not a fan of using archive bits or modified dates, because any of them can be confusing if you back up or restore a local directory with another backup program.

+5
source

Are you really pushing for ftp , or can you use rsync instead?


If ftp requires the idea of ​​mhenry1384 , this is roughly what rsync (anyway, half of it, rsync ) looks at modification times for files that differ ...).

+3
source

(Waiting for a comment on the main question to be answered before the extension)

The strategy will be:

  • Find files modified using dates, times, archive bits or hashes (depending on OS)
  • Using this list, create an FTP script DELIVERY of these files
  • Run the FTP script.
+2
source

Have you considered using archive bits in a file?

0
source

Jonas

How often can files change?

If they change in a predictable time interval, you may consider using modified and other date attributes in the file.

0
source

I know this is an old thread, but while I was looking for the same solution, I came across this link, which can be quite useful: Script FTP

0
source

Using git-ftp is relatively simple. But it only works if your computer is the only one that changes the folder on the ftp server ...

I heard that rsync works too, but I'm not sure about it, I never used rsync ... And this is not ftp ...

0
source

git -ftp works very well:

 apt-get install git-ftp 

in the application folder:

 git config git.ftp.xxxx.url ftpservice.server.com/root/dir/for/ftp git config git.ftp.xxxx.user myUsername git config git.ftp.xxxx.password myPassword 

it should be only if the target has been updated by another ftp client (it changes ftpservice.server.com/root/dir/for/ftp/ git-ftp.log to the current commit)

 git ftp catchup --scope xxxx 

// edit sources //

 git commit -m "new version" git ftp push --scope xxxx 

and you can see what happens:

 git ftp show --scope xxxx git ftp log --scope xxxx 
0
source

Netbeans has good ftp. it supports selective loading, loading

0
source

All Articles