Pupsave Restore Backups

Moderator: Forum moderators

User avatar
fredx181
Posts: 3250
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 408 times
Been thanked: 1412 times
Contact:

Re: Pupsave Restore Backups

Post by fredx181 »

wizard wrote: Wed Jan 29, 2025 4:49 pm

...
2. Bigger issue, the program code uses this to find the backups:

Code: Select all

ls *.BKP*

This normally returns only the files/directories containing ".BKP".

That doesn't work in BW64. In the image below, the first "ls" command shows all contents
of the directory. Next, you see that "ls *.BKP*" returns only "upper" and "work", so the program will
fail. Have no idea why this happens, perhaps @dimkr or one of our other experts can explain it.

Thanks
wizard

This may work (avoiding output of the contents: "upper" and "work"):

ls --help wrote:

-d, --directory list directories themselves, not their contents

ls -d *.BKP*/
But it adds a slash at the output, don't know if that gives an unwanted side-effect.
Without the appending slash: ls -d *.BKP* it will show also any other file, e,g. *tar.gz or *tar.xz containing .BKP in the name , not sure if that's wanted in your setup :?: .

User avatar
wizard
Posts: 2080
Joined: Sun Aug 09, 2020 7:50 pm
Location: Oklahoma, USA
Has thanked: 2822 times
Been thanked: 749 times

Re: Pupsave Restore Backups

Post by wizard »

@fredx181

Yeah, found several ways to fix it:

ls -d *.BKP* (like your suggestion)
or
ls | grep -F ".BKP"

ls -d *.BKP*/ Not a good choice since the program needs a list of all the .BKP files

Could also do it with "find"

Right now am using: ls | grep -F ".BKP"

Really curious why BW64 gives ls *.BKP* output as the contents of the directory (upper, work) and older Pups give the list of files/directories with the .BKP string.

Thanks
wizard

Big pile of OLD computers

williwaw
Posts: 2038
Joined: Tue Jul 14, 2020 11:24 pm
Has thanked: 182 times
Been thanked: 387 times

Re: Pupsave Restore Backups

Post by williwaw »

other puppies might call ls from buysbox?
and bookwormpup might be (the output below is from vanilladpup)

Code: Select all

0 ~ $ ls --version
ls (GNU coreutils) 9.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Richard M. Stallman and David MacKenzie.
Last edited by williwaw on Wed Jan 29, 2025 9:43 pm, edited 1 time in total.
User avatar
wizard
Posts: 2080
Joined: Sun Aug 09, 2020 7:50 pm
Location: Oklahoma, USA
Has thanked: 2822 times
Been thanked: 749 times

Re: Pupsave Restore Backups

Post by wizard »

@bigpup

Made changes:
1. Now works in BookwormPup64
2. If user tries to "restore" an un-compressed" savefolder, a copy is made.

This version for testing only.

Let me know what happens and if #2 is a good approach.

Thanks
wizard

Attachments
pupsave-backup-or-restore250129.sh.tar.gz
Extract before using
(1.57 KiB) Downloaded 9 times

Big pile of OLD computers

Post Reply

Return to “Utilities”