Skip to content

bob-lee/motioneyecleancloud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Clean cloud service for motioneye

To delete old media files on Google Drive that were uploaded by motioneye, download cleancloud folder and copy it to your pi somewhere, for example to /home/pi. Then add a cron job as follows:

sudo crontab -e

0 0 * * * python /home/pi/cleancloud/cleancloud.py

Some assumptions are:

  • upload service is working ok
  • file persistence is working ok
  • camera id is 1
  • service name is gdrive

Following functions are added in uploadservices.py

  • clean_cloud()
  • exist_in_local()
  • get_local_folders()
  • GoogleDrive.clean_cloud()
  • GoogleDrive._get_children()
  • GoogleDrive._delete_child()
  • GoogleDrive._get_file_metadata()
  • GoogleDrive._get_file_title()

Also _request() function was modified to accept a new optional parameter method to override the default GET.

Periodically codes here will compare media folders in local and cloud and will delete a cloud folder that does not exist in local as it must be an old folder that was deleted by motioneye as configured by users' file persistence setting.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages