Archive and Delete Dropbox Files Created 2/7 Days Ago

We keep a backup of files in Dropbox and want to automate archiving or deleting backup files that are ‘X’ days old.

For example:

  • Search the backup folder
  • Move any file, created more than 2 days ago, to the Archive
  • Search the Archive folder
  • Delete any file created more than 7 days ago

I’ve read the Date & Time functions page, which outlines formulas to use though I’m not sure which modules (e.g., Text Parser, Dropbox Search Module) to use to run the formulas (i.e., calculate how ‘old’ a file is) and execute the action (i.e., move / delete).

You can probably do it like so:

  • List files in folder module
    – Pick Backup as the folder to list from
  • Add Move file module
    – Filter the connection between List and Move by the Updated timestamp field and apply your formula, so only matching items get moved

Do the same for Deleting from Archive folder, possibly as it’s own scenario since it’s a separate check and action

I didn’t test this myself, depending on the response from the List module, you may need to use the Iterate flow control before the Move module

1 Like

You’d have one scenario timed to run daily (I’m assuming you want to archive/delete daily).

Start with a Router. On one branch, you’d have the List All Files module and then have a date filter on the path to the Move module, something like this:

On the lower branch you’d have the same List All Files module and on the path to the Delete module the only difference would be you’d have -7 rather than -2.

You have to start with a Router (or have two scenarios) as you couldn’t just chain one branch onto the end of another as the second part would be filtered by the first part.

1 Like