SFTP, nested folders, and how to get rid of them. - VisualCron - Forum

Community forum

erich
  •  erich
  • No customer Topic Starter
2009-02-10T22:56:02Z
Apologies in advance, I'm *hoping* this turns out to be a stupid question...

I'm creating a scheduled SFTP connection to a server where our home folder contains a folder named "IN", which in turn has subfolders that are named more or less unpredictably.

in other words, we'll see something like:
/home/us/IN/someuser.datestamp/file1.zip
/home/us/IN/someuser.datestamp/file2.zip
/home/us/IN/someotheruser.datestamp/file3.zip
/home/us/IN/someotheruser.someotherdatestamp/file4.zip


I can download all that just fine, and VisualCron will delete the files, which is what we want. But we also want to delete the empty folders, and I cannot figure out how I should be doing this in VisualCron.

Wildcards don't appear to work with the "delete folder" command, so my next thought was to just delete and re-create the IN folder itself, but VisualCron apparently can't do this if subfolders still exist.

So, what's the right way handle this?
Support
2009-02-10T23:07:15Z
It is a good question. Actually we do download and create all sub folders. It is not optional right now to not save these empty sub folders. I convert this question into a request that you want an option not to download empty sub folders. Correct?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
erich
  •  erich
  • No customer Topic Starter
2009-02-10T23:40:17Z
Support wrote:

It is a good question. Actually we do download and create all sub folders. It is not optional right now to not save these empty sub folders. I convert this question into a request that you want an option not to download empty sub folders. Correct?



Actually shortly after posting I came up with a workaround using a semaphore file and a scheduled task running on the remote server, so you can consider this sorted.

but I can see a few ways VisualCron could handle this - feel free to consider these as potential feature requests.

Option 1 - what you said... Skip empty folders entirely on download, do not create them on destination host.

Option 2 - when downloading files with "Include subfolders" and "delete source file after copy" both checked, also include an option to delete emptied subfolders. This would have been the preferred solution in this case.

Option 3 - add an "include subfolders" option to the "delete folder" SFTP command. As far as I can tell, the "delete folder" command only works on a single, empty folder with a known name, which makes its usefulness extremely limited.

Thanks!
Scroll to Top