keep certain number of backup file
Moderator: Martin
keep certain number of backup file
I'm using google drive(experimental) to backup flow everyday. I use date as part of file name. I wonder if there is a way to keep last 3 backup file in gdrive.
Option2 is if it's not available, is there a sample flow to do the same thing on local drive then I can delete all the files on gdrive, upload local copies.
Option3 will be keep desired copies locally then use foldersync to sync to gdrive.
Option2 is if it's not available, is there a sample flow to do the same thing on local drive then I can delete all the files on gdrive, upload local copies.
Option3 will be keep desired copies locally then use foldersync to sync to gdrive.
Re: keep certain number of backup file
Just init file list the Gdrive folder after you upload. Then check if the list length is more than 3, delete the oldest one.
I have a very complex idea about the backup flow to store 1 week and some special backup. But again, I was distracted and never complete it until now.
I have a very complex idea about the backup flow to store 1 week and some special backup. But again, I was distracted and never complete it until now.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: keep certain number of backup file
Can you share your generic clean up flow? I guess I need to write script to sort by timestamp in desc order, right?
Re: keep certain number of backup file
I am back editing my AM backup flow as your reply yesterday. Finally finish it partially, but was distracted too to complete 2 of other flow parts, in order to help creating this flow I need some time to try and use the my flowception to help testing the backup. Only then, I will share it (Although haven't finish all, but at least fully functioning for the finished part).
The core function of the removing is simply Action Init variable file list (in your case the gdrive list). The result is list of the files, sort by name. Since you use the date as part of the name, the oldest one will be the first one on the list. Simply create a script after the init
This will check if the list of files is more than 3, then add the first element (the oldest one) to the delete list. Use {dellist} in action Delete files, after the script. (in your case delete from gdrive). you might want to try in in local folder first, and make sure you copy the folder as backup and as test files.
The core function of the removing is simply Action Init variable file list (in your case the gdrive list). The result is list of the files, sort by name. Since you use the date as part of the name, the oldest one will be the first one on the list. Simply create a script after the init
Code: Select all
dellist = newList();
if(length(files) > 3)
addElement(dellist, files[0]);
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: keep certain number of backup file
I have tested the backup flow and it is running great. Now I have daily and manual backup flow. You can modify it to suit your need
Automagic Backup : viewtopic.php?f=3&t=7858
Automagic Backup : viewtopic.php?f=3&t=7858
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: keep certain number of backup file
That's terrific. I will try out tonight.
Re: keep certain number of backup file
You may find Google Drive's native file version history feature will work so you can get back to previous versions of the same file without having to manage it yourself.yxd0018 wrote:I'm using google drive(experimental) to backup flow everyday. I use date as part of file name. I wonder if there is a way to keep last 3 backup file in gdrive.
Option2 is if it's not available, is there a sample flow to do the same thing on local drive then I can delete all the files on gdrive, upload local copies.
Option3 will be keep desired copies locally then use foldersync to sync to gdrive.
https://support.google.com/drive/answer ... ktop&hl=en
Re: keep certain number of backup file
Thanks.
Between keeping different files by myself and trusting Google versioning system with the same file name, I found the former easier and more reliable.
Between keeping different files by myself and trusting Google versioning system with the same file name, I found the former easier and more reliable.
Re: keep certain number of backup file
Have you had problems with Google's versioning actually not working?yxd0018 wrote:Thanks.
Between keeping different files by myself and trusting Google versioning system with the same file name, I found the former easier and more reliable.
Re: keep certain number of backup file
after testing the versioning system in gdrive, I changed my mind and use that. Thanks.