Search code examples
bashdropbox

keep directory but delete files in it with dropbox bash api


wp-dropbox is a directory in my dropbox.

Dropbox-Uploader/dropbox_uploader.sh delete  /wp-dropbox

The command delete the wp-dropbox and all files in it. How can i keep the directory --wp-dropbox,at the same time to delete all files in it?

Dropbox-Uploader/dropbox_uploader.sh delete  /wp-dropbox/*

The above command can't achieve my target.


Solution

  • The Dropbox API doesn't offer the ability to delete all of the files in a folder without deleting the folder itself. We'll consider it a feature request.

    Workarounds:

    • List all of the files and delete them specifically.
    • Delete the folder entirely, and then recreate just the folder.