madx/sharedrop

Add script to cleanup old files ?

Opened this issue · 3 comments

MoOx commented

It's a question not sure if it should belong in here

madx commented

I think we can provide a --clean flag to the utility so you can use sharedrop --clean in a crontab/recurring task

MoOx commented

So we might need a parameter to specify on which criterias we drop the drops :)

MoOx commented

Here is an quick copy/adapted/paste from an old script of mine

#!/usr/bin/env zsh

#SHAREDROP_CLEANUP_PATH=...
SHAREDROP_CLEANUP_LIFETIME=${SHAREDROP_CLEANUP_LIFETIME:-7}

find $SHAREDROP_CLEANUP_PATH -mtime +$SHAREDROP_CLEANUP_LIFETIME -type f -name "*.png" -delete

# todo adapt this
terminal-notifier \
  -title "ShareDrop" \
  -message "Cleanup done" \
  -sound Pop \
  -contentImage ShareDrop.icns \
  -open file://$SHAREDROP_CLEANUP_PATH