![]() |
|
#1
|
|||
|
|||
|
Hi,
I have Windows Server 2003 on my local. i have Vandyke Client Pack and I am connecting to SFTP site using : vsftp -b D:\DeleteOldFiles.txt --auth publickey -i "C:\Program Files\VanDyke Software\Key" FirstUser@sftp.XXXX.com I wish to write DeleteOldFiles.txt in way.. it should delete files older than 90 days from a folder on SFTP site. I have been using "ForFiles" command when dealing with local directories. When I try the same after connecting to SFTP site, "ForFiles" is an invalid command. I know, one needs to have ForFiles.exe in Windows/System32 folder, how can I install it on SFTP side? Is there any other tool packaged along with Vandyke Client Pack which can provide me same functionality? Hope you can help. |
|
#2
|
|||
|
|||
|
Hi Raina,
Thanks for the question. The vsftp command-line client doesn't currently have a way to delete files based on age. If you want to use ForFiles on the remote, you would need to use vsh with a shell connection rather than vsftp. What you may want to consider doing is using VRALib. It is a COM object that allows SFTP functionality to be incorporated into a script or program that you write. It may be easier to get and parse the necessary data to accomplish your goal using VRALib rather than vsftp. If you want to use vsftp to accomplish the goal, you could use a script to get a file listing using vsftp, and log the data. The script could then read in the data and parse it for file age. Then you could write a batch file to delete the files that are 90 days old. Finally, the script could issue another vsftp command to run the batch file to delete the old files. Does this help to answer your question? As a note, I have created a feature request in our ClientPack enhancement database to add this type of functionality. Should a future release of vsftp have the ability to delete files that are older than a certain date, we will post to this forum thread. If you would like to be notified directly, please complete and submit the form at the following location: Submit Feature Request |
|
#3
|
|||
|
|||
|
Hey Todd..
I switched to VRALib. And it works for me. ![]() Thanks a lot! |
|
#4
|
|||
|
|||
|
Excellent news Raina!
I am glad to hear that you were able to accomplish your goal using VRALib. If you have any questions as you continue to use VRALib, please let us know. |
![]() |
| Tags |
| delete old files, forfiles |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|