Page 2 of 2

Re: Pupsave Restore Backups

Posted: Wed Jan 29, 2025 6:27 pm
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 :?: .


Re: Pupsave Restore Backups

Posted: Wed Jan 29, 2025 8:33 pm
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


Re: Pupsave Restore Backups

Posted: Wed Jan 29, 2025 9:41 pm
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.

Re: Pupsave Restore Backups

Posted: Wed Jan 29, 2025 9:42 pm
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


Re: Pupsave Restore Backups

Posted: Thu Jan 30, 2025 3:52 pm
by wizard

@williwaw

other puppies might call ls from buysbox?

Not sure about that. BW64 also has ls version 9.1, wonder if you duplicated @bigpup test condition of choosing an un-compressed savefolder backup, would you get the same failure?

Thanks
wizard


Re: Pupsave Restore Backups

Posted: Thu Jan 30, 2025 7:45 pm
by williwaw

I have always gotten the output of work and upper with vanillaDpup, Makes sense to me as you are passing the foldername as an arguement to ls, albiet with wildcards. I also tried various iterations of wildards with and without the dot before BKP. will test your latest soon.

Have you been following the discussion in viewtopic.php?t=644

edit: download/file.php?id=28941 worked fin both compresses and uncompressesed with vanilladpup


Re: Pupsave Restore Backups

Posted: Thu Jan 30, 2025 9:06 pm
by wizard

See first post for Revision 250130
Version 4 now adds the date of the original backup to the restore name.

wizard