Page 1 of 1

Restore Pupsave file hotbkup saved files.

Posted: Sat 01 Oct 2011, 07:29
by 8-bit
After a heck of a lot of work and testing, I have made a restore script for pupsave files backed up with 2byte's HotBkp for frugal pups.
It works ok and I have did minor error checking on blank entry windows.
The hardest part was getting the progress bar to work and that was just due to coding errors.
No warranty is supplied with this script and you can examine it before you run it.
Just remember to drag and drop your backed up pupsave file and the destination directory to the entry windows and Hit the Restore button.
If you fail to do so, you will be greeted with a full progress bar and a message in a red window you will have to close along with the progress bar window.
I could have made that cleaner, but I wanted to stay away from external temporary files.
DO NOT TRY THIS SCRIPT FOR NORMAL FILE COPY!
EDIT:
I made some changes and you now can also use the script for file copy. You cannot copy multiple selected files all at once though.


So here it is. Try it and let me know what you think.

It is also an example of using a progress bar with an actual application.

Posted: Sun 02 Oct 2011, 00:37
by Flash
Does this only work with pupsave files or could I use it to copy a directory containing a bunch of mp3 audio books to a mp3 player?

Posted: Sun 02 Oct 2011, 01:25
by 8-bit
Flash, I have never tried using it to copy multiple files to a destination directory.
I guess I will have to back up my pupsave file and give it a try.
Remember though that if a number of files is copied to a directory located in a frugal install, you can overflow it really quick.
It happened to me!
No check is currently done to make sure there is room on the destination for the file to be copied/replaced.

2byte knows how to write code for that check and I have not been able to decipher it or it would have been included.

Just thought about it some more. Short answer is NO.
Reason is it was not made to handle multiple files and so I do not think the progress bar would work along with one might end up with one very large file with a very large name composed of all the files.

Posted: Sun 02 Oct 2011, 02:08
by Flash
Okay, thanks. I might give it a try anyway just to see what happens. I have several USB flash drives I'm not using at the moment.

Posted: Sun 02 Oct 2011, 03:46
by 8-bit
Flash and others,
DO NOT USE my script for copying files. It contains a sed command that is relying on the file being a valid pupsave backup file from hotbackup and that sed command removes the last 19 characters,dots,dashes from the filename.
So if you try to copy a file like "/root/gtkdialog_template.sh" to another directory you end up with a file called "gt" which is the original filename with the last 19 characters,dots,underlines,dashes gone.
If I was smarter, I could check for the characters "BKP" in the file name and bypass that sed command if "BKP" was not part of the filename.
But for now, I have to say it is only for the purpose it was made for.

Posted: Sun 02 Oct 2011, 06:08
by 8-bit
Boy have I been busy!
I have again updated PupsaveRestore.sh to allow user to also use it to copy files from one location to another.
You can still use drag and drop for the file source and destination directory. But the difference now is that a long file name does not get truncated during the copy process and the script still works as it did before to restore pupsave files.

The updated script is in the first post.

Can't run PupsaveRestore.sh

Posted: Sun 02 Oct 2011, 20:05
by Henry
Hello, fellow Oregonian,

I've been using the excellent Pupsave Hot Backup, now v 1.3, for years, Your restore sounds very handy, avoiding a reboot, copy, and rename, another reboot, etc.

I can't get this script to run. Where should it be put?

I'm using QuirkyNop-1.2 with Xfce, Thunar, no rox.

My pupsave looks like this:
qrkysave-A.2fs

A typical pupsave backup looks like this:
qrkysave-A.2fs.BKP-11.10.01-18.23

Thanks in advance for any advice.

Posted: Sun 02 Oct 2011, 21:37
by 8-bit
That you cannot get it to run is most likely my fault.
At the end of the script is a line that starts it with gtkdialog4.
Truthfully, I do believe that if you change that line to gtkdialog3 it should run ok.
Or you could visit bkhome.org/blog/ and get the compiled PET for gtkdialog4 from there.
But for now, it will save me making yet another revision if you open the script in geany and edit the line from gtkdialog4 to gtkdialog3.

Also, I have never tried restoring (replacing) a pupsave that is in use and would not recommend it.

Posted: Sun 02 Oct 2011, 22:23
by Henry
Thanks,

That fixed it.

However I seem to have misunderstood the intent of the program. I somehow thought you had found a magic way to "hot" restore also. Should have known :-).

Posted: Sun 02 Oct 2011, 22:34
by 8-bit
Since Puppy runs in memory, restoring to a saved version can cause problems if you are running the version you are trying to restore.
It would have been nice, but that is just too advanced for my limited programming ability.
It is also the reason why one should never rename his pupsave while puppy is running.

pupsaverestore-0.0.2_20140512

Posted: Sat 17 May 2014, 15:18
by ASRI éducation
pupsaverestore-0.0.2_20140512 # added gettext # added version # improve GUI
Tested with Puppy Precise 5.7.1
Cordialement,