Batch - FTP delete folders older than
<p>I have two cams at my house, creating images nearly every day. They save them to my FTP-Server (Fritz.Box\Nas drive). </p>

<p>The folder structure is as follows: </p>

<pre><code>+-2016-08-24
+-+Subfolder
+----+AnotherSubfolder
+-------+File.jpg
+-2016-08-25
+-+Subfolder
+----+AnotherSubfolder
+-------+File.jpg
+-2016-08-26
+-+Subfolder
+----+AnotherSubfolder
+-------+File.jpg
...
</code></pre>

<p>Now I can login to my FTP via batch file (on Windows) like this: </p>

<pre><code>echo user foo&gt;ftpcmd.txt
echo 1234&gt;&gt;ftpcmd.txt
... CODE HERE ...
echo quit&gt;&gt;ftpcmd.txt
ftp -n -s:ftpcmd.txt foo.com
</code></pre>

<p>On Windows I would delete 2-day-old local files via </p>

<pre><code>forfiles /d -2 ...
</code></pre>

<p>On FTP it won't work. So, how can I delete the folders AND SUBFOLDERS/SUBFILES older than 2 days?</p>

<p>I know about this question: <a href="https://stackoverflow.com/questions/9626618/batch-delete-files-on-ftp-older-than-x-days">Batch delete files on FTP older than x days</a></p>

<p>But I couldn't figure out a good solution for me. Again, I wanna have a batch file, that checks the folders (ex.: 2016-08-24) against the date - 2 days and delete them AND THEIR Subdirectories AND SUBFILES.</p>

<p>Hopefully that is not a spam question, because there is another one, asking nearly the same. </p>

<p>Greetings<br>
Dirk</p>