How to back up pupsave file while it's in use?

Booting, installing, newbie
Message
Author
eqin
Posts: 2
Joined: Tue 21 Aug 2018, 07:14

How to back up pupsave file while it's in use?

#1 Post by eqin »

Hi,

I've had a bit of a disaster and accidentally deleted the folder which contains my current Puppy frugal install pupsave file...

I'm still using that pupsave file (not even sure how that's possible) but when I switch off my laptop it will be gone.

Could anyone tell me if there's any way I can backup the current pupsave file while using it? I've looked through the forums but am not sure if this is possible. My Linux knowlege is pretty limited as you can see.

Thanks for any help

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#2 Post by musher0 »

Hello eqin.

It's possible because Puppy loads the pupsave in RAM.

Since this is an emergency, please try:

Code: Select all

cd /mnt/home
zip -9ry emergency.zip /initrd/pup_rw/*
zip may complain that it couldn't copy everything, but in such a situation
we do our best, eh? (zip may not know what to do with some special "pipe"
files and such, but these are not that important ATM. They will be recreated
in your next pupsave.)

Please note you'll get the material, but not the ?fs format...
You'll have to recreate a pupsave file at next boot, big enough to
accomodate all the material in the zip file.

When you have your new pupsave file, unzip the "emergency.zip" archive
in its own directory. Then copy only directories
├── etc
├── lib
├── mnt
├── opt
├── root
├── usr
└── var
from the "emergency folder" directly in your Pup at top level (the "/"
directory). They should fall into place correctly as you confirm the
copy/copies in ROX-Filer.

Once the copy is finished, exit your Pup and reboot with your new
populated pupsave. Keep your fingers crossed?! (No guarantees...)

Any questions please ask.

Please get into the habit of making back-ups of your pupsave before
another unfortunate accident like this happens again? :idea:

IHTH
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
mikeslr
Posts: 3890
Joined: Mon 16 Jun 2008, 21:20
Location: 500 seconds from Sol

As a safety measure

#3 Post by mikeslr »

Hi eqin.

I've never used musher0's method, so can't vouch for it. I'd do the following just in case you have to start from scratch:

Menu>Setup>Puppy Package Manager, Select Uninstall. Open the window so that you can see every application you installed. Take a Snapshot.

Menu>Setup>SFS-Load. Take a snapshot of the SFSes you have loaded.

Save the Snapshots somewhere on /mnt/home.

Your real problem will be recovering any datafiles you may have deleted; as to which I don't have a clue.

mikesLr

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#4 Post by bigpup »

It's possible because Puppy loads the pupsave in RAM.

Sorry to say this is not true.
There is a lot of what is in the pupsave that is not loaded into RAM.

Any frugal install only loads the pupsave as read/write and loads in RAM stuff that affects the normal setup and bootup of Puppy.
Setup changes, configurations used, etc.....
Installed programs, saved documents, saved images, etc.... are just in the pupsave ready to be read into RAM when requested to be used.

musher0,
Nice idea!
I tested your console command and it did copy what is in RAM, from the pupsave, but it is still only what I state above.

Sorry to say, but I think you lost the save by deleting it. Any installed programs, stored data files, documents, etc.......
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

User avatar
mikeslr
Posts: 3890
Joined: Mon 16 Jun 2008, 21:20
Location: 500 seconds from Sol

#5 Post by mikeslr »

Hi,

My best guess is that even though Puppies do not load everything into RAM until needed, it does load configurations and settings. Consequently, musher0's instructions might still be useful in saving you some time. Just combine it with the advice i gave about taking screenshots so you can duplicate (re-install/reload) pets and SFSes.

After you create a new SaveFile/Folder, reinstall the applications you had and reload the SFSes. Don't add anything else (for now). Don't bother to customize or making settings for applications any more than you have to -- e.g. wifi, if needed.

After you've installed all pets and loaded the SFSes, Save. Then make a backup copy of your Save file.

Then follow musher0's instructions with regard to which files/folders you should copy from the emergency.zip as these should have the settings and configurations you made in your deleted SaveFile/Folder. If asked if you want to 'overwrite' say yes. Puppy's operating system is in RAM, so any thing you copy into, for example, "lib" only exists in RAM until you perform a Save. Save and reboot.

If there's a problem which you can't otherwise resolve, you can always revert to your 'clean' backup SaveFile/Folder.

mikesLr

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#6 Post by musher0 »

Hi guys.

@bigpup: I think what you say about not everything of the pupsave being
loaded in RAM... well, it depends if you have specified pfix=nocopy or not.

If you're not using the nocopy setting, I think everything should be in RAM,
except what the user may have symlinked, e.g. /root/my-documents to
/mnt/home/my-documents, maybe the caches for the browser, and the like.

And since those symlinked files and dirs are not in the pupsave that has
been inadvertedly erased, they are safe, right? The user will just have to
recreate the symlinks in the next pupsave.

My suggested solution is not perfect, it never is when you are reacting to
an emergency call such as eqin's. I just happened to be there when eqin
called for help, and I simply suggested the best to my knowledge "off the
top of my head."

BTW, eqin? Did the solution work?

I'm clumsy with tar/bzip, so if someone could come up with a one- or
two-liner for such a situation, I think all users in a pinch will appreciate.

I mention the tar/bzip solution because, IIRC, tar does not care at all about
the type of file being stored, whereas zip does. Can someone validate this
statement? TIA.

@mikeslr: taking snapshots can be helpful reminders; however IMO they
do not replace the "substance", I mean the actual contents of the pupsave.

Whereas creating an archive from /initrd/pup_rw, however limited it may
look like on the surface, does save some, and potentially all, material.

My 2¢. BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
davids45
Posts: 1326
Joined: Sun 26 Nov 2006, 23:33
Location: Chatswood, NSW

Use PupSave Backup

#7 Post by davids45 »

G'day from Outback Oz,

There is a small package in many Pups' Utilities Menu that saves the Pup Savefile while in use.
The full title of this package often includes '-hot-backup' if you don't see the PupSaveBackup mentioned in your Pup's 'Utilities' Menu.

I have extracted the bin file for this and in Pups that don't have it, I run it as a dragged-to-the-pinboard application.
PupSaveBackup offers the choice of compressing the savefile in a zip or xz format.

I have not had any problem in extracting a compressed savefile.

This is very handy when trying new software - make a backup then install your package (sfs so much better that pets) then fix the mess by just rebooting to another Pup, delete the corrupt savefile and expand and copy the old one back to the Pup's directory.

Off to the desert,

David S.

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#8 Post by Mike Walsh »

Personally, I only ever use copy'n'paste to back-up any save-file/folder within the 'kennels'.....and it's never let me down yet.

And I use this same procedure with both 'awake' and 'sleeping' Pups.

Of course, YMMV. But it's pretty reliable, despite not being the 'accepted' way of doing things!


Mike. :wink:

eqin
Posts: 2
Joined: Tue 21 Aug 2018, 07:14

#9 Post by eqin »

Thanks everyone for the replies, I really appreciate your help.

I followed musher0's instructions for creating a zip backup file, then also did what mikeslr advised.

However, before putting the zip file to the test I (fortunately) found a pupsave file which I had backed up to an SD card a few months ago (I'd forgotten all about this). So to cut a long story short, I just used this and have updated stuff I've added in the last few months. I was going to test musher's method just to see what happened, but my laptop is pretty slow and my pupsave quite large, and I've wasted enough time already today through my carelessness...

I'll definitely be more careful in future though :D. Cheers again for your help.

PS. I did try the Pupsave Backup package that davids45 has mentioned but couldn't get it to work.

User avatar
a_salty_dogg
Posts: 180
Joined: Sun 15 Dec 2013, 19:08

#10 Post by a_salty_dogg »

Thanks Mike Walsh,

I'd always been in the habit of copying "live" pupsave files, i.e. while they were loaded and being written to by any given distro (though admittedly trying to keep down to a minimum use of things like browsers, which are constantly writing to profile directories, while I did it) without any noticeable problem, until I started lurking here a few months ago and kept reading it's not good practice. :oops:

Since then I've got myself into the habit of only backing up pupsave files which aren't in current use, so it's reassuring to read your post, thank you!

r__hughes
Posts: 359
Joined: Thu 13 Apr 2006, 04:14
Location: Montreal, Canada

pupsave backup

#11 Post by r__hughes »

This pupsave-backup script makes a backup of the last-saved pupsave file while a frugal puppy is running. Just make sure the script is executable.

I have been using this for years from pup431 upto and including pup570) it works well but I can't find any reference to the unsung hero who originally wrote it.
Attachments
pupsave_backup.zip
unzip & run when required
Kudos to the anonymous author
(3.49 KiB) Downloaded 116 times
--- quad booting Slacko57NPAE, Slacko56NPAE, Slacko55PAE (with OO4, devx, Gimp) & WXP on DELL Dimension 2400 PC & DELL Latitude 630 Laptop using grub.
---USB-Flash booting same on Samsung N110 WXP Netbook and Lenovo q100 WXP netPC.

User avatar
mikeslr
Posts: 3890
Joined: Mon 16 Jun 2008, 21:20
Location: 500 seconds from Sol

back up pupsave while it's in use

#12 Post by mikeslr »

Hi all,

The "common knowledge is that you can't simply copy a pupsavefile/folder while its in use". Like most "common knowledge" it just gets passed on without reflection. I'd suggest that the "common knowledge" had its origin before the ability to turn off the Automatic Save became widely known.

I think the more accurate statement would be that if you copy the SaveFile/Folder while it's in use, the copy may contain errors if, while the copy was being made, the system was also writing to the SaveFile: the operative word being "may". With the Automatic Save turned off, or during most of the time when the system wasn't writing to the SaveFile/Folder the SaveFile/Folder is just the source for information the system reads into RAM. Hence, the reports of "I've done it and didn't have a problem."

I had doubts about musher0 suggestion, but didn't then have the time to go into it. It has to do with "what's in RAM". A couple years ago I wondered how, if everything was copied into RAM, a 500 Mb when decompressed LibreOffice file, together with the contents of a 500 Mb SaveFile (which would decompress to about 1200, Mbs plus the contents of the Puppy_Version_Number.sfs plus everything else all fit into 512 Mbs of RAM.

The term blivit came to mind.

And I sort of recalled that unless the argument "copy" was used at that time --computers commonly having only 512 Mbs RAM-- there had been a limit of 256 Mbs set as to how much would be copied into RAM from "source files" in order to leave 256 Mbs of RAM for working: editing, adding, deleting, making changes of any sort. I don't know to what extent such limit may exist in current Puppies. And frankly, I don't also know how and where caching and buffering take place.

Sometime after my befuddlement, rufwoof explained the existence of inodes, http://murga-linux.com/puppy/viewtopic. ... 458#827458. Using 'inodes' as a search term revealed their use had been discussed extensively on this thread: http://murga-linux.com/puppy/viewtopic. ... 842#281842. My laymen's definition of inodes is that they are pointers held in RAM as to where the rest of an application or datafile is located.

Perhaps if the 'copy' argument is included in the boot argument, and there is sufficient RAM, all files are copied into RAM. In it's absence, as I understand it, only the 'then necessary' files are copied into RAM and inodes in RAM are created pointing to the location of where potentially necessary files are located.

mikesLr

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

Re: pupsave backup

#13 Post by musher0 »

r__hughes wrote:This pupsave-backup script makes a backup of the last-saved pupsave file while a frugal puppy is running. Just make sure the script is executable.

I have been using this for years from pup431 upto and including pup570) it works well but I can't find any reference to the unsung hero who originally wrote it.
Many thanks, r_hugues.

By any chance is there an original date on your file? This may help finding
the author -- at least when it was originally published. You mention pup431,
which means ~ 2010, yes?

@mikeslr:
Perusing this script, I came across a potential answer to your question:
"[Line 35] For best results, shut down all applications before backing up."
If no app is writing or saving anything to the pupsave file, copying the
pupsave file or zipping it shouldn't create any problem or conflict.

(style of par. edited Aug. 25 2019, 16 h 35)

@Mike_Walsh:
Yep! Good old copy will always work! I have just successfully tested in ROX
a straight copy from /initrd/pup_rw to mnt/home/tentative/.

BFN.
Last edited by musher0 on Sat 25 Aug 2018, 20:35, edited 1 time in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#14 Post by musher0 »

@Mike_Walsh again:

Still bringing water to your mill on 2nd thought. I would perhaps suggest a
"modulation" or "variant", however.

In console, a Puppyist in a similar bind as eqin could type:

Code: Select all

cd /mnt/home
mkdir emergency
cd emergency
rsync -aqmz --exclude .wh.* --exclude *.bak /initrd/pup_rw/* .
If there is enough room on the HD, there is no need for zipping or archiving.
(Thus giving my solution in post #2 above the pink slip.)

Rsync's advantage is that it provides a very fast copy (which may be of the
essence in an emergency such as this -- or not) and it allows excluding stuff
we do not need (here we do not need the "whiteout" nor the back-up files.)

We cannot repeat too many times, it seems, to Puppyists and all computer
users, this old adage of computing: back-up, back-up, back-up --
if you wait until an incident happens, it's too late.

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#15 Post by Mike Walsh »

musher0 wrote:@Mike_Walsh again:

We cannot repeat too many times, it seems, to Puppyists and all computer
users, this old adage of computing: back-up, back-up, back-up --
if you wait until an incident happens, it's too late.
Which is why the entire, currently 14-strong kennels are backed-up once a month, regular as clockwork. And also why I'm steadily migrating those Pups using the modern save-folder over to the older style of save-file. Which may seem like a retrograde step to some, but there is 'method to my madness'.

Quite simply, a save-file, being in a compressed state already, copies a hell of a sight quicker. I always run with

Code: Select all

pfix=fsck
.....and my Pups all run from hard-drive frugals. And back-up to the same.....so, unlike those of us who run from USB, the entire process only takes somewhere around 1-2 minutes per Pup. The whole kennels is usually 'backed-up' in under an hour.

Works for me.....and I've never suffered any kind of corruption yet. (*Touch wood!*)


Mike. :wink:
Last edited by Mike Walsh on Thu 23 Aug 2018, 21:40, edited 1 time in total.

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#16 Post by bigpup »

@bigpup: I think what you say about not everything of the pupsave being
loaded in RAM... well, it depends if you have specified pfix=nocopy or not.

Nocopy boot option has no affect on how the save is mounted/loaded.

Pupmode controls how the save is used.
Which relates to what storage device it is on, which also controls how the save is loaded/mounted.
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

r__hughes
Posts: 359
Joined: Thu 13 Apr 2006, 04:14
Location: Montreal, Canada

#17 Post by r__hughes »

@Musher0 & anyone else interested in the history of the hotbackup file for frugal puppies.

I went back in time to an old computer gathering dust in the basement and found a file called hotbkup.tar.gz uploaded by a user named 2byte on Sat 12 Dec 2009 at 17:08.

Attached is a zip file with his original upload & a html copy of the original forum discussion page :)

Thank you 2byte wherever you are
Attachments
hotbackup.zip
(12.92 KiB) Downloaded 119 times
--- quad booting Slacko57NPAE, Slacko56NPAE, Slacko55PAE (with OO4, devx, Gimp) & WXP on DELL Dimension 2400 PC & DELL Latitude 630 Laptop using grub.
---USB-Flash booting same on Samsung N110 WXP Netbook and Lenovo q100 WXP netPC.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#18 Post by musher0 »

r__hugues?

You're good! National Archives Canada should offer you a job! :)
Many thanks for this research.

With your info I was able to bump that old thread. There are
updates, corrections and locales on page 6 of that thread.

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
glene77is
Posts: 196
Joined: Tue 17 Aug 2010, 22:09
Location: Memphis, TN, USA
Contact:

hotbackup file for frugal puppies

#19 Post by glene77is »

r__hughes wrote:@Musher0 & anyone else interested in the history of the hotbackup file for frugal puppies.

I went back in time to an old computer gathering dust in the basement and found a file called hotbkup.tar.gz uploaded by a user named 2byte on Sat 12 Dec 2009 at 17:08.

Attached is a zip file with his original upload & a html copy of the original forum discussion page :)

Thank you 2byte wherever you are
>>> to Hughes,
Thanks for the history retreival.
Reading through the code, it appears that this is the 'first run' version.
Perhaps its title should be Puppy HotBkUp_v1.0 by 2byte.

>>> Edited 200603
We tried running this v.1.0 , in our UpupBB+20 system, without success.
As the code states, the saveFILE must be saveFILE.2fs or .3fs.
However,
(1) The first line "file picker widget" would not allow selection of 'any' file.
(2) The "Quit" button killed the program, but left a runaway process
scrolling error notations in the Terminal.

>>> Edited 200604

(1) This is the method of 'backing-up' :
### cp -f -v "$PUPSAVE_PATH" "$destdir" ### 200604-0613

(2) We found reference that the gtkdialog used for the Main Gui was an early version, from "pygtk.org".

However, it was interesting to read through the terse code.
Thanks again to "Hughes" for the historical retrieval.

It should be noted that the v.1.2 ( included in the UpupBB system )
does run 'as advertised', on our system. 'Thank you' , to 2byte.



We use a Puppy Backup to 'tar.gz' titled "B2T" presented at :
http://murga-linux.com/puppy/viewtopic. ... 24#1050224

...
Attachments
B2U_Running-in-Terminal_2_med.jpg
B2T code under test in Geany Terminal.
(225.68 KiB) Downloaded 52 times
Last edited by glene77is on Thu 04 Jun 2020, 11:29, edited 3 times in total.
Puppy Linux is more fun than a barrel of M$ monkeys :P
www.geocities.WS/glene77is
glene77is --- {^,^} --- electricity is shocking, Memphis, TN, USA.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#20 Post by musher0 »

Just a general reminder:

In addition to the suggestions above
you can safely do a regular back-up of your pupsave file with zip, lzop or other,
while in the Pup, provided no other program is running.

Meaning: you don't play a game, you don't edit a text, you don't browse through
your music collection, etc., until your backup is finished.

IHTH
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

Post Reply