Forum Index \ DriveHQ Customer Support Forum \
Read/Reply : 13340/6
  • gregchao
  • (4 posts)

I would like to monitor a folder for files.  Are you allowed to poll the folder using FTP.list  every 15 secs to see if there is a file in the folder?  Is there a better way to do this?


9/8/2023 11:14:23 PM

  • DriveHQ_Support
  • (651 posts)
Subject: Re:Monitoring a folder for file uploads

We recommend using DriveHQ FileManager client software's folder synchronization feature. You can create a cloud-to-local sync task to sync a cloud folder to a local folder. DriveHQ FileManager is more efficient in monitoring the cloud folder for changes, esp. if the folder has a lot of files and subfolders.

Using FTP's LIST command probably is ok, though you need to be careful not to create too much load (relative to your plan level). If you need to list a folder every 15 seconds continuously, using FTP has one disadvantage in that it either requires a persistent connection, or it needs to log in every 15 seconds.

If the folder contains a lot of files and subfolders, the LIST command is not efficient. How frequently is a new file added to the folder? If the frequency is much lower than once per minute, then you can check the parent folder first. For example, if you want to monitor the folder "/Folder1/Folder2" for new files, instead of "LIST /FOLDER1/FOLDER2", you can "LIST /FOLDER1" first. Assume FOLDER1 only contains FOLDER2, then it is very efficient to find FOLDER2's last-modify time. If FOLDER2's last-modify time has not changed, then you don't need to LIST the contents of FOLDER2 as it has not changed.


Reply
9/9/2023 12:51:33 AM

  • Gregory Chao
  • (4 posts)
Subject: Re:Monitoring a folder for file uploads

Thanks.  I checked the DriveHQ Syncronization feature.  It is very cool.  However, the fastest rate is 1 minute.  I really want 15 seconds so I will have to ponder if this is acceptable.

The folder will be normally empty.  As soon as a file appears, I will download it and then delete it.  I will process the data and then upload the results to another folder. 

Could I set up a sycronization and do an FTP.list at the same time?  That way, I do not have to FTP.list as much.  However, I have no way of keeping them sync'ed so they work in tandem. 

Do you have any other suggestions?


Reply
9/9/2023 7:56:51 AM

  • Gregory Chao
  • (4 posts)
Subject: Re:Monitoring a folder for file uploads

One additional question.  If I use the DriveHQ syncronization feature, do I need to have the DriveHQ FileManager always running?


Reply
9/9/2023 10:42:15 AM

  • DriveHQ_Support
  • (651 posts)
Subject: Re: Monitoring a folder for file uploads

User: Gregory Chao  -  9/9/2023 7:56:51 AM

Thanks.  I checked the DriveHQ Syncronization feature.  It is very cool.  However, the fastest rate is 1 minute.  I really want 15 seconds so I will have to ponder if this is acceptable.

The folder will be normally empty.  As soon as a file appears, I will download it and then delete it.  I will process the data and then upload the results to another folder. 

Could I set up a sycronization and do an FTP.list at the same time?  That way, I do not have to FTP.list as much.  However, I have no way of keeping them sync'ed so they work in tandem. 

Do you have any other suggestions?

DriveHQ FileManager supports real-time folder sync. For your case, you should use the Real-time sync instead of the scheduled sync. The Scheduled sync has a minimum interval of 10 minutes. The real-time sync usually can sync a file within about 15 seconds to a few minutes, dependent on your number of files in the folder (and the amount of data to upload/download). 

I don't see why you need both FileManager and FTP for your usage case. Why not just use one of them? 

 


Reply
9/9/2023 5:10:55 PM

  • DriveHQ_Support
  • (651 posts)
Subject: Re: Monitoring a folder for file uploads

User: Gregory Chao  -  9/9/2023 10:42:15 AM

One additional question.  If I use the DriveHQ syncronization feature, do I need to have the DriveHQ FileManager always running?

Yes, FileManager needs to be running all the time. If your PC/server is unattended (that nobody is logged on to the PC/server), then FileManager needs to be configured to run in the service mode. You can configure it in Options -> System Options, see the screenshot below: (Check the checkbox of "Automatically start in service mode after PC reboot). You can then quit the GUI mode and run it in the background service mode. 

 

 


Reply
9/9/2023 5:19:10 PM

  • Gregory Chao
  • (4 posts)
Subject: Re:Monitoring a folder for file uploads

Thanks.  Just wanted to get back to you.  Using DriveHq FileManager Syncronization with the "Real Time" setting works great!!!  Also, I am using a virtual desktop that can be running 24 hours a day so keeping DriveHQ Filemanager always running is no problem.


Reply
9/15/2023 2:24:09 PM

Quickly Reply

Please logon and reply, Not DriveHQ Member?


Leading Cloud Surveillance service

Leading Enterprise Cloud IT Service Since 2003