Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Feature Requests

Reply
 
Thread Tools Display Modes
Old 05-27-2021, 11:48 AM   #81
wfd
Human being with feelings
 
Join Date: Nov 2016
Posts: 37
Default Request +1

Would be a welcome addition. +1
wfd is offline   Reply With Quote
Old 07-23-2021, 03:46 AM   #82
Phazma
Human being with feelings
 
Join Date: Jun 2019
Posts: 2,872
Default

Bump.
Phazma is offline   Reply With Quote
Old 07-23-2021, 04:58 AM   #83
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,874
Default Script: Save project and keep only X backups

Hi everyone,

After an extensive long period of testing, I think I can safely release my script mentioned above.
I was a bit hesitant cause a script which delete project files (even backups) is a bit... sensitive.
Detecting what are backup files of a project is made my checking files in its folder and checking their name. The pattern matching used by the script to find backups files is very strict so I didn't had any issue.


Code:
"^" .. proj_name .. "%-(%d%d%d%d%-%d%d%-%d%d_%d%d%d%d%d%d)%.rpp%-bak
(where ^is begining of file name, %d are numbers, proj_name the project file name without extension etc. So it is pretty strict!)

Be sure to have Timestamp backup activated in Option -> Project -> Saving.

The script has been released in my free reapack repo as:
  • X-Raym_Save project and keep only X backups.lua

Map it to CTRL+S keyword shortcut for eg, or/and place it in your File menu.

Demo:



Default is set to 5. You can use a preset script if you want to alter the value (better than editing the file cause compatible with future update).

https://gist.github.com/X-Raym/f7f63...ile-preset-lua

It would be simpler if I added some kind of popup setting but it is the kind of set and forget thing so I didn't bother such things.

Let me know if it works as expected!
And feel free to make a donation if you like it :P

PS: Because of it's importance and sensitivity, I still do think this feature should be native, in preferences, as good as my script can be :P

Last edited by X-Raym; 07-23-2021 at 07:39 AM.
X-Raym is offline   Reply With Quote
Old 07-23-2021, 06:53 AM   #84
Coachz
Human being with feelings
 
Coachz's Avatar
 
Join Date: Oct 2010
Location: Charleston, SC
Posts: 12,769
Default

When I run the script it saves my project but did not delete any files here on windows 10 Reaper v6.33rc3
ReaScript Name: Save project and keep only X backups Version: 1.0.4

__________________
Track Freezing Scripts

Coachz Repo

Last edited by Coachz; 07-23-2021 at 07:33 AM.
Coachz is offline   Reply With Quote
Old 07-23-2021, 07:30 AM   #85
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,874
Default

@Coachz
As explain above the pattern is very strict.


it should be in


here are what it looks like on my hand: project_name-2021-07-23_134824


I have second precision, you don't have it.



note sure what you don't have the same pattern. Probably check Timestamp in settings ?







(off topic, but please unquote my message from your previous post, it clutter the discussion a bit :P)
X-Raym is offline   Reply With Quote
Old 07-23-2021, 07:36 AM   #86
Coachz
Human being with feelings
 
Coachz's Avatar
 
Join Date: Oct 2010
Location: Charleston, SC
Posts: 12,769
Default

As usual, you are right. :-) I enabled the timestamp backup option and it works great. Thank you for the really helpful script. I also uncluttered the previous post. Rock on !
__________________
Track Freezing Scripts

Coachz Repo

Last edited by Coachz; 07-23-2021 at 07:47 AM.
Coachz is offline   Reply With Quote
Old 07-23-2021, 07:38 AM   #87
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,874
Default

@coachz
But you haven't unclutter this one haha 😅



No need to quote if the related post is just the one before :P


Anyway, glad it works for you. Once it will be set to your favorite save keyboard shortcut, you will not even notice it is here.
X-Raym is offline   Reply With Quote
Old 07-23-2021, 07:49 AM   #88
Coachz
Human being with feelings
 
Coachz's Avatar
 
Join Date: Oct 2010
Location: Charleston, SC
Posts: 12,769
Default

Excellent, I won't know it's there but I can still see you ! :-)

__________________
Track Freezing Scripts

Coachz Repo
Coachz is offline   Reply With Quote
Old 07-23-2021, 11:32 AM   #89
tonalstates
Human being with feelings
 
tonalstates's Avatar
 
Join Date: Jun 2020
Posts: 656
Default

Thanks for this X-Raym, I just deleted like 3k .rpp-bak files yesterday so I'll def try it out.

One thing, does it work if I have a separate folder? I have the option to save to a separate path called "BACKUPS" in the same project folder but it doesn't seem to acknowledge this, is there a way around this for it to work with that path?
tonalstates is offline   Reply With Quote
Old 07-23-2021, 01:02 PM   #90
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,874
Default

@tonalstates
There is a variable in USER CONFIG AREA of the script where you can put subfolder name. This can be hooked by a preset file, which is better than direct script editing to allow future update.

Check link about preset script above.


I didn't retest the subfolder feature for a while but hopefully it works as expected.
X-Raym is offline   Reply With Quote
Old 07-24-2021, 01:37 PM   #91
JonLinnarson
Human being with feelings
 
JonLinnarson's Avatar
 
Join Date: Jul 2020
Posts: 724
Default

Quote:
Originally Posted by X-Raym View Post
Let me know if it works as expected!
And feel free to make a donation if you like it :P
I tried to make this work since I couldn't get amalgamas script to work, but something I don't really understand in the script is the

backup_folder = "backup" -- Without separator.

line.

When I try to add the address to my backup folder in the line beneath (backup_folder = "E:\Jon Backup\REAPER\TEMP\REAPER BACKUPS") and press Ctrl+S, Reaper just tells me Line 36: invalid escape sequence near '"E:J"'

Does this script not work if my backup folder is located on a external drive or am I doing something else wrong?
JonLinnarson is offline   Reply With Quote
Old 07-24-2021, 04:17 PM   #92
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,874
Default

@JonLinnarson
You are totally right,
this is was meant to be relative path, not absolute,


I didnt take into account the case of people writing full path;


On todo list then!
X-Raym is offline   Reply With Quote
Old 07-25-2021, 01:29 AM   #93
JonLinnarson
Human being with feelings
 
JonLinnarson's Avatar
 
Join Date: Jul 2020
Posts: 724
Default

Quote:
Originally Posted by X-Raym View Post
@JonLinnarson
You are totally right,
this is was meant to be relative path, not absolute,


I didnt take into account the case of people writing full path;


On todo list then!
Ah, okay! So it only works if my backup folder is located in the Reaper default place?
JonLinnarson is offline   Reply With Quote
Old 07-25-2021, 03:20 AM   #94
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,874
Default

@JonLinnarson
How come your backup folder isn't at the default place ? What setting did you change ? Can you show a screenshot?


(please use reply button instead of quote, for readability)

EDIT: ok I succeed to reproduce, it is because of Automatic backup options at regular interval. Same for coachz incomplete timestamp issue. I'm on it.

Last edited by X-Raym; 07-25-2021 at 03:39 AM.
X-Raym is offline   Reply With Quote
Old 07-25-2021, 04:27 AM   #95
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,874
Default

Ok so v1.0.6, I have change a bit,
you shouldn't need to customize anything in the script, no pattern or backup folder.



Main user variables are:


Code:
limit = 5
do_automatic_backup_dir = true

Where do_automatic_backup_dir also check for the automatic backup path.



See how it works in both project dir and automatic backup dir



The script now support automatically made .rpp-back, which don't have the seconds timecode.



See how it support auomatically named backup in project dir along the one made at save. Beware of windows file ordering though.

PS: the global .rpp backup can be very heavy if you have tons of file... This may perhaps slowdown the script. I woul advice to keep .rpp-back in project folder only.
Not the script doesn't check automatic backup dir if the option is checked in reaper project saving settings.
X-Raym is offline   Reply With Quote
Old 07-25-2021, 11:16 AM   #96
JonLinnarson
Human being with feelings
 
JonLinnarson's Avatar
 
Join Date: Jul 2020
Posts: 724
Default

@X-Raym

I changed my settings so that my project folders didn't end up a huge mess again. I used to have it so that both my reapeaks and backups were saved in the project folder but it ended up with me having maybe 300-1000 different files in each project folder.

I sat for almost a whole day cleaning up in all of my old project folders, deleting the unnecessary backups and rebuilding the peak files on my external drive, and it gave me back over 70gb of my C: drive!

I instead created a "temp" folder on a external drive with three subfolders: Cache, reapeaks and Reaper backups. I don't need to have it on the external drive though, I just placed it there in case it ever grew to the same size again.

With your script though, it wouldn't be a problem so I could move the temp folder back to my C drive if that's the problem!

This is my settings now (don't know how to insert pictures directly):
Attached Images
File Type: png Backup settings.png (9.6 KB, 122 views)
JonLinnarson is offline   Reply With Quote
Old 07-25-2021, 01:41 PM   #97
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,451
Default

Just to let you know, I have removed my "amagalma_Keep x number of most recent timestamped backups of current project file (deletes older ones - no undo!).lua" script and replaced it with a new script pack that offers everything one could wish.


Check it here.
__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)
amagalma is offline   Reply With Quote
Old 07-25-2021, 02:04 PM   #98
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,874
Default

@JonLinnarson
Can you confirm that the script is now working as expected for you ?
X-Raym is offline   Reply With Quote
Old 08-09-2021, 04:10 AM   #99
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,874
Default Update

* v1.0.7 (2021-08-09)
+ Save only if project is dirty variable
# Pattern fine tuning for project name with dash and other lua esape characters
X-Raym is offline   Reply With Quote
Old 08-15-2021, 08:20 AM   #100
Coachz
Human being with feelings
 
Coachz's Avatar
 
Join Date: Oct 2010
Location: Charleston, SC
Posts: 12,769
Default

I'm trying to use the preset script (attached) and set limit to 12 but I only get 5 on run. I followed the directions. Thanks for any ideas.



__________________
Track Freezing Scripts

Coachz Repo

Last edited by Coachz; 08-15-2023 at 07:04 AM.
Coachz is offline   Reply With Quote
Old 08-15-2021, 12:30 PM   #101
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,874
Default

@coachz
You have to run the preset file as an action, not the parent script.
X-Raym is offline   Reply With Quote
Old 08-15-2021, 02:34 PM   #102
Coachz
Human being with feelings
 
Coachz's Avatar
 
Join Date: Oct 2010
Location: Charleston, SC
Posts: 12,769
Default

Quote:
Originally Posted by X-Raym View Post
@coachz
You have to run the preset file as an action, not the parent script.
Oh. I guess I missed that instruction. Thank you I'll report back. I only need to include the variables I wish to change in the preset file right?
__________________
Track Freezing Scripts

Coachz Repo
Coachz is offline   Reply With Quote
Old 08-15-2021, 09:43 PM   #103
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,874
Default

@Coachz
You current file is good. It has both the running code and the desired variable.



Detailed instructions are providen on the gist page.
X-Raym is offline   Reply With Quote
Old 08-09-2022, 06:56 AM   #104
mozart999uk
Human being with feelings
 
Join Date: Nov 2010
Posts: 1,721
Default

Is there a way to get this script to also keep one file per date like Amalgama's?
mozart999uk is offline   Reply With Quote
Old 08-09-2022, 08:07 AM   #105
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,874
Default

@mozart999uk
It could be moded to extend that, but if amagalma's already do that, better use his script instead :P
X-Raym is offline   Reply With Quote
Old 08-09-2022, 08:30 AM   #106
mozart999uk
Human being with feelings
 
Join Date: Nov 2010
Posts: 1,721
Default

Unfortunately amagalma's doesn't seem to be working properly for a few of us and he / she seems to be off radar at the moment :-(
mozart999uk is offline   Reply With Quote
Old 08-13-2022, 08:31 PM   #107
PitchSlap
Human being with feelings
 
PitchSlap's Avatar
 
Join Date: Jan 2008
Location: Vancouver, BC
Posts: 3,792
Default

Option to limit # of backup files (overwriting the oldest)
https://forum.cockos.com/showthread.php?t=58511

I requested this over 12 years ago, so long overdue IMO.
I have my backup time set every 2 minutes since I get somewhat frequent crashes and want to minimize loss of work, but especially with project folders on different drives this is a mess to manually remove when unneeded.
__________________
FRs: v5 Media Explorer Requests, Global Quantization, Session View
Win10 Pro 64-bit, Reaper 6(x64), AMD 3950x, Aorus X570 Master, 64GB DDR4 3600, PowerColor Red Devil 5700XT, EVO 970 2TB, 10TB HD, Define R6
PitchSlap is offline   Reply With Quote
Old 09-10-2022, 07:04 AM   #108
airon
Human being with feelings
 
airon's Avatar
 
Join Date: Aug 2006
Location: Berlin
Posts: 11,817
Default

Ok, here are some hard stats to show how the backup system could benefit a little from limiting the number of project backups kept around.

I use a location to keep those backups, via Preferences/Project/Project saving and the option Save to timestamped file in additional directory checked. That path contained the following :
  • 14 months of project backup files (07/21 - 09/22)

  • 10118 files (I save a lot)

  • 153.091.804 kilobytes

How about keeping the last 10 of the same name ? Or however many I'd like ?

And how about a warning message shown after crossing the 1000 file mark right after saving the project once again ? Inspire the user to clean that directory up or have Reaper do that.

I increment the version via the function File/Save new version of project a few times a day. Still I have several dozen backups of the same session in the backup folder.

I know we're catering to the folks who don't want to think about this, but then again that's what most helpful functions tend to do.
__________________
Using Latch Preview (Video) - Faderport 16 setup for CSI 1.1 , CSI 3.10
Website
"My ego comes pre-shrunk" - Randy Thom

Last edited by airon; 09-10-2022 at 07:34 AM.
airon is offline   Reply With Quote
Old 02-16-2023, 10:43 PM   #109
Javier Robledo
Human being with feelings
 
Javier Robledo's Avatar
 
Join Date: Jul 2014
Posts: 634
Default Back up time

Hi

Is there a way to set a "less than one minute" backup time ?

Thanks
Javier Robledo is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:20 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.