curl ftp删除多个文件sh脚本
我正在尝试使用curl(在ubuntu上的sh脚本中调用)通过ftp删除包含多个文件的文件夹,但没有取得太大成功。我可以删除一个空文件夹,如果直接调用我可以删除单个文件。问题是这是一个备份文件夹,名称会改变。
经过研究,似乎无法使用curl ftp命令删除多个文件,唯一的方法是列出文件,然后处理列表并删除每个文件。但我似乎找不到例子,有人可以帮助我吗?
我使用以下命令列出文件:
curl -l ftp://ftpadd/path/ --user "user:pw"
I am trying to delete a folder with multiple files via ftp using curl (called within a sh script on ubuntu), and not having much success. I can delete an empty folder, and I can delete individual files if called directly. The thing is this is a backup folder and the names will change.
After researching it seems you can't delete multi files using the curl ftp command, and the only way is to list the files, then process the list and delete each one. But I cannot seem to find an example, can someone help me with this?
I'm using the following comamnd to list the files:
curl -l ftp://ftpadd/path/ --user "user:pw"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
调用 tnftp 删除文件
called tnftp to delete the files