M
M
m00nkey2014-07-17 13:54:52
bash
m00nkey, 2014-07-17 13:54:52

Bash script that checks file creation dates on ftp and local server, is it feasible?

Greetings!
Guys, we need a bash script that checks the creation dates of files on ftp and local server, and in the case when ftp finds a later file, it downloads it, preserving the FTP directory structure.
roughly speaking:
we run the script from /home/user/
it checks the entire file in /home/user/soft_name/* (looks at all directories, at each file)
looks at ftp ftp://user:[email protected]_ftp:/path/ to/file/* (looks in all directories and all folders in the same way)
if it finds a file on ftp with a later date than on the local server, or a file that does not exist at all, it adds it to a directory on the local server.
Is it possible to implement this? which way to look?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor, 2014-07-17
@m00nkey

Why do you prefer FTP?
There are also ready-made synchronization tools: rsync, csync2, lsync .
If ftp is still important, then look away, for example wget -m or lftp with the mirror option.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question