Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 14 Nov 2018, 01:38
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
How to back up pupsave file while it's in use?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [18 Posts]   Goto page: 1, 2 Next
Author Message
eqin

Joined: 21 Aug 2018
Posts: 2

PostPosted: Tue 21 Aug 2018, 03:23    Post subject:  How to back up pupsave file while it's in use?  

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
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 12958
Location: Gatineau (Qc), Canada

PostPosted: Tue 21 Aug 2018, 03:52    Post subject:  

Hello eqin.

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

Since this is an emergency, please try:
Code:
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
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
mikeslr


Joined: 16 Jun 2008
Posts: 2770
Location: 500 seconds from Sol

PostPosted: Tue 21 Aug 2018, 09:40    Post subject: As a safety measure  

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
Back to top
View user's profile Send private message 
bigpup


Joined: 11 Oct 2009
Posts: 11252
Location: Charleston S.C. USA

PostPosted: Tue 21 Aug 2018, 10:11    Post subject:  

Quote:
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.......

_________________
I have found, in trying to help people, that 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 Shocked
Back to top
View user's profile Send private message 
mikeslr


Joined: 16 Jun 2008
Posts: 2770
Location: 500 seconds from Sol

PostPosted: Tue 21 Aug 2018, 13:19    Post subject:  

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
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 12958
Location: Gatineau (Qc), Canada

PostPosted: Tue 21 Aug 2018, 17:55    Post subject:  

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
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
davids45


Joined: 26 Nov 2006
Posts: 1161
Location: Chatswood, NSW

PostPosted: Tue 21 Aug 2018, 18:30    Post subject: Use PupSave Backup
Subject description: its script works in Old Pups
 

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.
Back to top
View user's profile Send private message 
Mike Walsh


Joined: 28 Jun 2014
Posts: 4361
Location: King's Lynn, UK.

PostPosted: Tue 21 Aug 2018, 20:21    Post subject:  

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

_________________
MY PUPPY PACKAGES | 'Thanks' are always appreciated!
--------------------------------------

Back to top
View user's profile Send private message Visit poster's website 
eqin

Joined: 21 Aug 2018
Posts: 2

PostPosted: Tue 21 Aug 2018, 21:10    Post subject:  

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 Very Happy. Cheers again for your help.

PS. I did try the Pupsave Backup package that davids45 has mentioned but couldn't get it to work.
Back to top
View user's profile Send private message 
a_salty_dogg


Joined: 15 Dec 2013
Posts: 136

PostPosted: Tue 21 Aug 2018, 21:11    Post subject:  

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. Embarassed

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!
Back to top
View user's profile Send private message 
r__hughes

Joined: 13 Apr 2006
Posts: 354
Location: Montreal, Canada

PostPosted: Wed 22 Aug 2018, 14:51    Post subject: pupsave backup
Subject description: run this script
 

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.
pupsave_backup.zip
Description  unzip & run when required
Kudos to the anonymous author
zip

 Download 
Filename  pupsave_backup.zip 
Filesize  3.49 KB 
Downloaded  37 Time(s) 

_________________
--- 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.
Back to top
View user's profile Send private message 
mikeslr


Joined: 16 Jun 2008
Posts: 2770
Location: 500 seconds from Sol

PostPosted: Wed 22 Aug 2018, 17:13    Post subject: back up pupsave while it's in use  

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.php?p=827458#827458. Using 'inodes' as a search term revealed their use had been discussed extensively on this thread: http://murga-linux.com/puppy/viewtopic.php?p=281842#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
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 12958
Location: Gatineau (Qc), Canada

PostPosted: Wed 22 Aug 2018, 21:12    Post subject: Re: pupsave backup
Subject description: run this script
 

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:
Quote:
"[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.

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)

Last edited by musher0 on Sat 25 Aug 2018, 16:35; edited 1 time in total
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 12958
Location: Gatineau (Qc), Canada

PostPosted: Wed 22 Aug 2018, 21:48    Post subject:  

@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:
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
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
Mike Walsh


Joined: 28 Jun 2014
Posts: 4361
Location: King's Lynn, UK.

PostPosted: Thu 23 Aug 2018, 06:47    Post subject:  

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:
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

_________________
MY PUPPY PACKAGES | 'Thanks' are always appreciated!
--------------------------------------


Last edited by Mike Walsh on Thu 23 Aug 2018, 17:40; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 2 [18 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Beginners Help ( Start Here)
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0783s ][ Queries: 13 (0.0119s) ][ GZIP on ]