I like to connect to remote FTP client and check if there is new files there on time to time basis.
If there are new files, I like to download it and send email to a person.
How can I do that? Is there any module?

Comments

nevets’s picture

How does this relate to Drupal? What files are you checking for?

mrahman252003’s picture

It is related Drupal, I like to check when there the cron is executed probably by a custom module. Or by some other way (that I don't know if possible or not). I want to automate the process. Now I am doing manually. For this I created a cron monitor module and each cron run I do the FTP connection and transfer the files, but problems are there,

-not sure if it is right way to do that.
-I need to save password and ftp account in the php code, security?
-My theme changes due to this, not sure where is problem

Now can you advise me?

nevets’s picture

What files are you checking on?

mrahman252003’s picture

It can be any files/folders (txt, images). Idea if it is new then that should be downloaded to my site (in a local directory)

Jaypan’s picture

You can implement hook_cron() which will be executed on Drupal cron runs. You can then use drupal_http_request() to make your FTP connection.

mrahman252003’s picture

Thanks, I tried to implement the module and it works with problem
-It changes my theme not sure why.
-I need to keep ftp password, is it safe to put it there in .module file?

I found another way running the php script with cron job provided by cpanel (https://www.drupal.org/node/369267)
It looks it is doing my work but again question where to store the ftp password?