geraldoramos / pigeon

Pigeon is a simple 3D printed cloud home surveillance camera project that uses the new Raspberry Pi Zero W
https://www.instructables.com/id/Pigeon-a-3D-Printed-Cloud-Home-Surveillance-Camera/
GNU General Public License v3.0
296 stars 22 forks source link

Feature Request - automatically delete Dropbox files older than X days #23

Open erikszewczyk opened 7 years ago

erikszewczyk commented 7 years ago

Hey Geraldo-

It would be really helpful to have a simple config parameter (and associated script) to automatically delete files off Dropbox after X days so we don't run out of storage space.

I've been trying to figure this out for the last half hour, and am thinking I could do this through a script in on_movie_end.sh - but my bash scripting skills are pretty weak and I haven't figured it out yet :)

Erik https://www.freelearner.how

geraldoramos commented 7 years ago

Hi Erik,

I fixed this in the last release. It is now deleting files after saving to Dropbox automatically. Let me know if this is not working for you!

There are no parameters for deletion though, you can't leave the file there for a specific amount of time, it just removes it after the Dropbox operation.

I'm interested in implementing other storage options in the future.

Regards,

Geraldo

erikszewczyk commented 7 years ago

Hey Geraldo-

Perhaps I wasnt clear enough, I meant deleting the files FROM Dropbox (not from the local storage, which yes that is working fine for me).

The problem I'm trying to avoid is running out of cloud storage (and generally there is no need to keep the video around for an extended period of time anyway).

Make sense?

Erik

geraldoramos commented 7 years ago

Ohhhh, Thanks for clarifying @erikszewczyk. I'm sorry for the misunderstanding.

I found this SO question that provides a solution to do it, using the same tool I'm using for dropbox integration (Dropbox_uploader) https://stackoverflow.com/questions/41098278/delete-files-after-certain-date-with-dropbox-uploader-sh

I will see if it works well and if it's possible to integrate that into the current workflow.

geraldoramos commented 7 years ago

Also, sorry for the late response, I completely missed it!

erikszewczyk commented 7 years ago

Thanks for looking into this, I also found the following: https://github.com/andreafabrizi/Dropbox-Uploader/issues/186

I spent over an hour the other day trying to get it working using the above approach, however I couldn't get the grep/sed to format the output cleanly enough for dropbox_uploader.sh delete to accept.

Hopefully this can be solved by someone with a bit more experience than I :)

Erik

geraldoramos commented 7 years ago

I will try my best, far from being experienced here =D

consciousweb commented 6 years ago

Any update here? I would really like this option as well, or preferably, an option to just save files to a new folder every day.

renschler commented 5 years ago

I set up a rule in integromat to automate this process.

It runs once a day and checks if there are any files older than 3 days in the specified pigeon folder, if so it deletes them.

You can create your own rules pretty easily, but I attached a screenshot of my setup and the blueprint.json file you can use to copy it.

integromate_dropbox_pigeon.zip

romquenin commented 5 years ago

Thanks for sharing @renschler ! I just discovered integromat thanks to you.

opeawo commented 3 years ago

FileQL lets you create auto-delete rules based on any of these criteria: number of days, file type, size and name-suffix. It should work for you as well.