|
|
|
12-16-2021, 08:49 AM
|
#41
|
Human being with feelings
Join Date: Jun 2019
Posts: 2,872
|
I think I found out what the problem was. It looks like the script doesn't recognize space characters in path names.
I had my timestamped backups set to a relative path called " Backups", with the space character in front of it. The reason for this is that it allows to show the backups subfolder always as first folder in an alphabetically sorted directory which may be full of other files.
Changing the name of the folder where backups are saved from " Backups" to "Backups" makes the script work again.
|
|
|
12-16-2021, 04:41 PM
|
#42
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
I am pretty sure this is not the reason. As you see in the paths in your logs.
Quote:
Originally Posted by Phazma
On saved project:
Code:
Failed to create TEST FILE TO DELETE at : /Volumes/Macintosh SSD/Reaper/Backup Script Test/Backup Testscript/Backups
On unsaved project:
Code:
Failed to create TEST FILE TO DELETE at : /Users/mirko/Library/Application Support/REAPER/ Reaper Media/Backups
|
The test script would create a temp file in these paths and then delete it. But it wasn't able to write. Is there such a thing in OSX like running an application as administrator? (Like in Windows). Maybe running Reaper as an admin will solve the problem. As long as the test script fails, there will be a problem with the backup limit script and with *any* script that tries to write or delete in these paths.
|
|
|
12-17-2021, 02:03 AM
|
#43
|
Human being with feelings
Join Date: Jun 2019
Posts: 2,872
|
Quote:
Originally Posted by amagalma
As long as the test script fails, there will be a problem with the backup limit script and with *any* script that tries to write or delete in these paths.
|
That was the case only until I changed the additional directory for timestamped backups from " Backups" to "Backups".
Now the results are like this:
On saved project:
Code:
Project is saved.
projpath = /Volumes/Macintosh SSD/Reaper/Backup Script Test/Backup Testscript 2
proj_filename = Backup Testscript 2
saveopts 8
in_add_dir = /Volumes/Macintosh SSD/Reaper/Backup Script Test/Backup Testscript 2/Backups
Number of backups found in in_add_dir_backups : 1
Succesfully created TEST FILE TO DELETE at : /Volumes/Macintosh SSD/Reaper/Backup Script Test/Backup Testscript 2/Backups
os.remove result: true, nil
~~ End of Test ~~
On unsaved project:
Code:
Project is unsaved.
in_add_dir = /Users/mirko/Library/Application Support/REAPER/ Reaper Media/Backups
Number of backups found in in_add_dir_backups : 5
Succesfully created TEST FILE TO DELETE at : /Users/mirko/Library/Application Support/REAPER/ Reaper Media/Backups
os.remove result: true, nil
~~ End of Test ~~
As you can see, the paths are exactly the same as in the previous example. Only that the script in both tests was searching a folder called "Backups", which didn't exist when I did the first test, as it was actually called " Backups". Your script ignores the space character in front of the folder name when searching for the path and for this reason (I believe) ends up not finding the folder if it starts with a space character and obviously can't create/delete a file.
|
|
|
12-17-2021, 03:20 PM
|
#44
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
I did some tests and found out that it is not a script bug, nor an OSX issue. The same thing happens in Windows too. It is a bug of the SWS API BR_Win32_GetPrivateProfileString.
It crops the spaces in front:
Code:
autosavedir = ({reaper.BR_Win32_GetPrivateProfileString( "reaper", "autosavedir", "", reaper.get_ini_file() )})[2]
I posted about it in the SWS Issue tracker.
Last edited by amagalma; 12-17-2021 at 03:27 PM.
|
|
|
12-17-2021, 04:00 PM
|
#45
|
Human being with feelings
Join Date: Jun 2019
Posts: 2,872
|
Quote:
Originally Posted by amagalma
|
Great, thanks for adding it to the issue tracker! Hope they can get it fixed at some point
|
|
|
12-18-2021, 03:31 AM
|
#46
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Quote:
Originally Posted by Phazma
Great, thanks for adding it to the issue tracker! Hope they can get it fixed at some point
|
They won't as this is a native Windows 16bit API and it works like this. cfillion closed the issue.
Perhaps, I have to create my own function to get the info correctly.
Last edited by amagalma; 12-18-2021 at 08:28 AM.
|
|
|
12-18-2021, 06:22 AM
|
#47
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Backup Limit Manual v1.03 changelog:
- Fix for paths starting with space (do not use BR_Win32_GetPrivateProfileString API)
|
|
|
12-19-2021, 04:48 AM
|
#48
|
Human being with feelings
Join Date: Jun 2019
Posts: 2,872
|
Quote:
Originally Posted by amagalma
Backup Limit Manual v1.03 changelog:
- Fix for paths starting with space (do not use BR_Win32_GetPrivateProfileString API)
|
Thanks for fixing this, works great!
|
|
|
01-05-2022, 12:53 AM
|
#49
|
Human being with feelings
Join Date: Apr 2014
Posts: 398
|
Amazing script Amagalma, as always!
I just sent you a small donation to let you know it's really appreciated!
Cheers!
|
|
|
01-05-2022, 04:38 AM
|
#50
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Quote:
Originally Posted by Infrabass
Amazing script Amagalma, as always!
I just sent you a small donation to let you know it's really appreciated!
Cheers!
|
Thank you very much!
|
|
|
01-19-2022, 01:48 AM
|
#51
|
Human being with feelings
Join Date: Jun 2019
Posts: 2,872
|
Again it doesn't detect save paths with a blank space as first character for folder name:
Code:
Project is saved.
projpath = /Volumes/Macintosh SSD/Reaper/WN - Say my Name (Vocal)
proj_filename = WN - Say my Name (Vocal Dry)
saveopts 8
in_add_dir = /Volumes/Macintosh SSD/Reaper/WN - Say my Name (Vocal)/Backups
Number of backups found in in_add_dir_backups : 0
Failed to create TEST FILE TO DELETE at : /Volumes/Macintosh SSD/Reaper/WN - Say my Name (Vocal)/Backups
~~ End of Test ~~
Not sure if that is because I updated to Mojave recently?
(It does work when removing the blank space character, tested that already).
|
|
|
01-19-2022, 03:11 AM
|
#52
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Don't use that tool that I made because it uses BR_Win32_GetPrivateProfileString, so it is outdated.
What is the name of the folder that has space(s) in the front? Please type it inside "". For example: " MyTestFolder" (has 3 spaces in front)
Then open your REAPER.ini and find "autosavedir=" and paste here exactly what it is.
(with the previous example, it should look like: "autosavedir= MyTestFolder" with 3 spaces in front)
edit: The Forum seems to crop multiple spaces to one, so please state how many spaces there are in your case.
Last edited by amagalma; 01-19-2022 at 03:17 AM.
|
|
|
01-19-2022, 03:46 AM
|
#53
|
Human being with feelings
Join Date: Jun 2019
Posts: 2,872
|
Quote:
Originally Posted by amagalma
Don't use that tool that I made because it uses BR_Win32_GetPrivateProfileString, so it is outdated.
What is the name of the folder that has space(s) in the front? Please type it inside "". For example: " MyTestFolder" (has 3 spaces in front)
Then open your REAPER.ini and find "autosavedir=" and paste here exactly what it is.
(with the previous example, it should look like: "autosavedir= MyTestFolder" with 3 spaces in front)
edit: The Forum seems to crop multiple spaces to one, so please state how many spaces there are in your case.
|
The name is " Backups" (with 1 space in front).
In REAPER.ini it says "autosavedir= Backups" (with 1 space in front).
|
|
|
01-19-2022, 06:33 AM
|
#54
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Quote:
Originally Posted by Phazma
The name is " Backups" (with 1 space in front).
In REAPER.ini it says "autosavedir= Backups" (with 1 space in front).
|
Looks ok..
Quote:
Originally Posted by Phazma
Not sure if that is because I updated to Mojave recently?
(It does work when removing the blank space character, tested that already).
|
May be?. I don't know..
Do you change the name of the folder in the Reaper Preferences while the script is running?
|
|
|
01-19-2022, 12:15 PM
|
#55
|
Human being with feelings
Join Date: Jun 2019
Posts: 2,872
|
Quote:
Originally Posted by amagalma
Do you change the name of the folder in the Reaper Preferences while the script is running?
|
No, I don't change the name but the path is relative:
This means that if the project is unsaved it saves backups into a folder called " Backups" inside the default recording path and as soon as I save the project it saves all further backups into a folder called " Backups" inside the project directory.
|
|
|
01-20-2022, 03:54 AM
|
#56
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
I do not know what else to say. The problem used to be because of a certain API, which existed in all OSs, and I fixed it.
Quote:
Originally Posted by Phazma
Thanks for fixing this, works great!
|
I can't reproduce it here, and I can't tell what might have changed in your system and made it not work again.. I am afraid I can only suggest you do not use a space in the name, or use some other character. Sorry!
|
|
|
01-20-2022, 04:01 AM
|
#57
|
Human being with feelings
Join Date: Jun 2019
Posts: 2,872
|
Ok no problem, thanks anyway for looking into it!
|
|
|
01-20-2022, 04:39 AM
|
#58
|
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
|
Try with "./ Backups". It's a path to the same " Backups" folder without starting with the space.
|
|
|
01-20-2022, 10:48 AM
|
#59
|
Human being with feelings
Join Date: Jun 2019
Posts: 2,872
|
Quote:
Originally Posted by cfillion
Try with "./ Backups". It's a path to the same " Backups" folder without starting with the space.
|
Thanks! Looks like with "./ Backups" it works again.
|
|
|
01-20-2022, 11:14 AM
|
#60
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Nice! Thanks cfillion for the solution!
I am curious: what does the autosavedir value looks like in your Reaper.ini, @Phazma, when the folder is set to "./ Backups"?
|
|
|
01-20-2022, 11:43 AM
|
#61
|
Human being with feelings
Join Date: Jun 2019
Posts: 2,872
|
Quote:
Originally Posted by amagalma
I am curious: what does the autosavedir value looks like in your Reaper.ini, @Phazma, when the folder is set to "./ Backups"?
|
autosavedir=./ Backups
And yet the ./ doesn't show up in the actual folder names. Not sure how that works but is definitely a nice macOS "hack" that cfillion proposed! Hope I won't find a way to break it again
|
|
|
01-20-2022, 01:09 PM
|
#62
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Since this works, perhaps I could add some code to automatically enter the the missing "./" if the folder starts with a space, for OSX. What do you think @cfillion?
|
|
|
02-02-2022, 04:20 AM
|
#63
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Added to ReaPack:
amagalma_Backup Limit Stand-Alone - Keep x number of most recent timestamped backups of the selected project(s) (browse to specify)
This is a stand-alone version of the amagalma_Backup Limit Manual script. Instead of working with the current project, you can browse and specify one or more projects.
It performs a manual cleanup according to the settings. It has the following features:
- You can specify any number of projects
- Automatically takes care of backup files created in the current project directory and in the additional directory if set (both with absolute or relative path)
- Supports all timestamp formats (both with seconds precision or not)
- You can specify how many backups you want to keep (default backup limit = 5)
- "Keep one file per different date" setting, if enabled, will keep one backup per different date that is earier than the backup limit that you have set, so that you can return to the state that your project had in a past date (default = enabled).
|
|
|
02-02-2022, 07:52 AM
|
#64
|
Human being with feelings
Join Date: Nov 2010
Posts: 1,722
|
wow! Excellent thanks :-)
|
|
|
04-29-2022, 10:58 AM
|
#65
|
Human being with feelings
Join Date: Jun 2020
Posts: 656
|
Any way to make this work with sub-projects? Which go automatically to the media folder designated at project settings
|
|
|
05-13-2022, 02:04 AM
|
#66
|
Human being with feelings
Join Date: Nov 2010
Posts: 1,722
|
Anyone got any idea why there's so many backups for the 10th may?
https://www.dropbox.com/s/n0uo942fvm...D%201.png?dl=0
I ran the standalone version with "files to keep " set to 1 and "keep one file per different date set to "y""
When I ran it, it said "no backups need to be deleted".
(Blacked out parts of file name are because of an NDA)
|
|
|
05-13-2022, 12:32 PM
|
#67
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Quote:
Originally Posted by tonalstates
Any way to make this work with sub-projects? Which go automatically to the media folder designated at project settings
|
I haven't used sub-projects at all and I currently do not have free time to investigate..
Quote:
Originally Posted by mozart999uk
Anyone got any idea why there's so many backups for the 10th may?
https://www.dropbox.com/s/n0uo942fvm...D%201.png?dl=0
I ran the standalone version with "files to keep " set to 1 and "keep one file per different date set to "y""
When I ran it, it said "no backups need to be deleted".
(Blacked out parts of file name are because of an NDA)
|
If you change "files to keep" to another number (for example, 3), does it work?
|
|
|
05-17-2022, 01:10 AM
|
#68
|
Human being with feelings
Join Date: Nov 2010
Posts: 1,722
|
Sorry for delay. Been away :-)
Thanks for getting back to me :-)
So this is what I get before and after setting "backups to keep" to "3".
https://www.dropbox.com/s/5kvyrvn2p1...03%20.png?dl=0
|
|
|
06-28-2022, 03:04 PM
|
#69
|
Human being with feelings
Join Date: Oct 2019
Posts: 229
|
Hey amagalma, great scripts, I'm just testing them out, one fear I always have with deleting things is if I get something wrong, and need to restore the deleted file for whatever reason.
It would be great if your script was able to delete them and move them into the Windows Recycle bin, but I noticed that they seem to be permanently deleted? If they went in the recycle bin, at least we have an option to restore a file later on if need be (or permanently delete afterwards).
|
|
|
07-24-2022, 04:29 AM
|
#70
|
Human being with feelings
Join Date: Dec 2019
Posts: 28
|
Hi amagalma!
Big thanks for your script it's very useful!
But there's a problem - the script "doesn't see" many of backup files in old projects.
For example, I go to the project which I worked a month ago. Run Manual script and it cleans up only a few backups that older than today. Can it be fixed?
My settings:
- 2
- y
|
|
|
07-24-2022, 04:52 AM
|
#71
|
Human being with feelings
Join Date: Dec 2019
Posts: 28
|
And now it seems that it doesn't work at all Though it works in the new fresh project...
|
|
|
07-25-2022, 07:22 AM
|
#72
|
Human being with feelings
Join Date: Nov 2010
Posts: 1,722
|
Think Amalgama maybe off grid at the moment :-(
|
|
|
08-07-2022, 12:47 PM
|
#73
|
Human being with feelings
Join Date: Dec 2019
Posts: 28
|
Quote:
Originally Posted by mozart999uk
Think Amalgama maybe off grid at the moment :-(
|
Sad
|
|
|
08-11-2022, 08:12 AM
|
#74
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Hey guys! I've been away for some time cause I am busy traveling and playing concerts during the summer. In September, when things will calm down I will look into any issues you may have. Cheers
|
|
|
08-12-2022, 02:06 PM
|
#75
|
Human being with feelings
Join Date: Dec 2019
Posts: 28
|
Quote:
Originally Posted by amagalma
Hey guys! I've been away for some time cause I am busy traveling and playing concerts during the summer. In September, when things will calm down I will look into any issues you may have. Cheers
|
Thank you!
|
|
|
09-07-2022, 03:29 PM
|
#76
|
Human being with feelings
Join Date: Oct 2021
Location: France
Posts: 363
|
Very useful script.
Can we run the automatic version only once in SWS global startup action ?
Does it check the current project at regular intervals ?
I have a problem when I open a second project in a new tab : it ask if I should terminate the script or run another instance ?...
Last edited by binbinhfr; 09-07-2022 at 03:56 PM.
|
|
|
09-08-2022, 02:55 AM
|
#77
|
Human being with feelings
Join Date: Dec 2019
Posts: 28
|
Quote:
Originally Posted by amagalma
Hey guys! I've been away for some time cause I am busy traveling and playing concerts during the summer. In September, when things will calm down I will look into any issues you may have. Cheers
|
Hi! Had a time to check this issue?
|
|
|
02-17-2023, 02:55 AM
|
#78
|
Human being with feelings
Join Date: Nov 2010
Posts: 1,722
|
HI. Just wondered how you were and whether you've had time to look at any of our issues yet?
|
|
|
03-02-2023, 11:54 PM
|
#79
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Sorry guys, I haven't had the time to check yet.. Will do some time soon-ish..
|
|
|
01-21-2024, 12:06 PM
|
#80
|
Human being with feelings
Join Date: Dec 2020
Posts: 48
|
I only just found these scripts, and they are super useful.
Just one thing: Personally I would prefer the backups to be moved to the trash rather than be completely deleted. That way, there would be just one more safety net...
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 02:09 AM.
|