Restore Pupsave file hotbkup saved files.

Miscellaneous tools
Post Reply
Message
Author
User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

Restore Pupsave file hotbkup saved files.

#1 Post 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.
Attachments
PupsaveRestore.tar.gz
My modified script that now allows file copy along with pupsave file restore.
(1.53 KiB) Downloaded 586 times
Last edited by 8-bit on Sun 02 Oct 2011, 07:05, edited 3 times in total.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#2 Post 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?

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#3 Post 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.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#4 Post 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.

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#5 Post 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.

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#6 Post 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.

Henry
Posts: 863
Joined: Sun 30 Jul 2006, 02:28
Location: Oregon USA
Contact:

Can't run PupsaveRestore.sh

#7 Post 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.

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#8 Post 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.

Henry
Posts: 863
Joined: Sun 30 Jul 2006, 02:28
Location: Oregon USA
Contact:

#9 Post 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 :-).

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#10 Post 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.

User avatar
ASRI éducation
Posts: 3197
Joined: Sat 09 May 2009, 12:10
Location: France
Contact:

pupsaverestore-0.0.2_20140512

#11 Post by ASRI éducation »

pupsaverestore-0.0.2_20140512 # added gettext # added version # improve GUI
Tested with Puppy Precise 5.7.1
Cordialement,
Attachments
pupsaverestore-0.0.2.jpg
(21.22 KiB) Downloaded 604 times
pupsaverestore-0.0.2_20140512_NLS.pet
(1.52 KiB) Downloaded 341 times
pupsaverestore-0.0.2_20140512.pet
(3.04 KiB) Downloaded 366 times
Projet ASRI éducation => [url=http://asri-education.org/]Association[/url] | [url=http://forum.asri-education.org/]Forum[/url] | [url=http://dl01.asri-education.org/]Dépôt[/url] | [url=http://kids.asri-education.org/]Espace kids[/url]

Post Reply