Is there a way to delete all files from an FTP folder every 30 minutes automatically?
Let's say that my details are the following:
Folder: /myfolder
Host: xxx.xxx.xxx.xxx
Username: myname
Password: mypassword
Thanks in advance!
Is there a way to delete all files from an FTP folder every 30 minutes automatically?
Let's say that my details are the following:
Folder: /myfolder
Host: xxx.xxx.xxx.xxx
Username: myname
Password: mypassword
Thanks in advance!
It's not really clear what do you ask for.
But if you want to automate the deletion via FileZilla, you cannot. FileZilla does not support any automation/scripting.
You have to use another FTP client. On Windows, you can use WinSCP.
A simple batch file (.bat
) to delete files from FTP folder using WinSCP scripting is like:
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/log="C:\writable\path\to\log\WinSCP.log" /ini=nul ^
/command ^
"open ftp://myname:mypassword@ftp.example.com/" ^
"rm /myfolder/*" ^
"exit"
To schedule the batch file run, use the Windows scheduler. See WinSCP guide to scheduling
The WinSCP can even generate a script template from an imported FileZilla session.
For details, see the guide to FileZilla automation.
(I'm the author of WinSCP)
make a file abc.php and write this code
array_map('unlink', glob("/myfolder/*"));
after that schedule a corn for hit this file every 30 min