Skip to content

How to empty a cloud folder properly  #19

Description

@MauroSteel

Working on a script in a case where multiple users upload files to an inbox-folder on Google Drive. Script is downloading, doing some stuff, moving & renaming according some scripting and uploading renamed files to different folders. Just working fine ;-)

At some point, i want to clear the inbox. However, in the meantime the script is running, user x can have added a new file to the inbox.

How can i prevent that new files will be removed? Or did i miss an argument?

Now i've (inbox is cloud-folder, down is local folder):

## download to local folder
/opt/jdrivesync/jdrivesync.sh --down -r "$inbox" -l "$down" 

{do stuff}

## empty local folder
rm -rf "$down"/*
rm -rf "$down"/.[a-z]*
## upload empty folder = empty cloud folder
/opt/jdrivesync/jdrivesync.sh --up -r "$inbox" -l "$down" 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions