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 Sat 22 Sep 2018, 08:44
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
Linux Script to restore savefile <Solved>
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [15 Posts]  
Author Message
dcung

Joined: 13 Jul 2018
Posts: 217
Location: Down Under - 3rd rock from Sun.

PostPosted: Wed 01 Aug 2018, 18:30    Post subject:  Linux Script to restore savefile <Solved>
Subject description: help writing one
 

Hi,

I installed 2 flavour of Puppy Linux on a laptop (frugal install).
I made backup of the savefiles in another partition/dir. I already tested restoring them manually thru GUI (file manager). That is I restore savefile1, by selecting/running flavour-2 on GRUB4DOS menu, and do the restore. And vice versa.

Before I hand the laptop to a family member for use, I would like to create an icon (file) on desktop, sort of a script to restore should something happen. This script would help as they live 2 hours away (return trip).. Smile

I'm not familiar with linux script, or at the most 'very rusty' and would take me ages. And a linux script person would be able to this in minutes.. Laughing

I'd like the script to open a window/terminal and runs following commands

wait "Hit a key to continue"
rm /installdir/currentsavefile
cp /backupdir/savefile /installdir/currentsavefile
wait "Hit a key to continue"


How do I go about doing this please?

Thanks.

Last edited by dcung on Thu 02 Aug 2018, 04:21; edited 1 time in total
Back to top
View user's profile Send private message 
rockedge


Joined: 11 Apr 2012
Posts: 808
Location: Connecticut, United States

PostPosted: Wed 01 Aug 2018, 19:29    Post subject:  

here is something you can save somewhere and drag a link to the desktop as a shortcut. I put it in /root/my-applications/restore-savefile make it executable and using rox-filer drag an it as icon to the desktop.

Code:
#!/bin/sh
gxmessage 'Do you want to Restore savefile?' \
   -buttons 'Cancel:1,Restore:2,Reboot:3,Shut Down:4' \
   -center


case $? in
    2)
   rm /root/spot/testsavefile.txt
   cp /root/ftpd/testsavefile.txt /root/spot/testsavefile.txt
    gxmessage 'Savefile Restored' -center -timeout 4
   ;;
    3)
   reboot
   ;;
    4)
   poweroff
   ;;
esac
Back to top
View user's profile Send private message Visit poster's website 
dcung

Joined: 13 Jul 2018
Posts: 217
Location: Down Under - 3rd rock from Sun.

PostPosted: Wed 01 Aug 2018, 21:09    Post subject:  

Thanks rockedge.!

That's what I need.
Tested and working!

In UpupBB, it presented popup.
No biggies, just another click. I'm sure they can handle that.
But if there's a way to bypass, that's even better.
Screenshot.png
 Description   
 Filesize   11.09 KB
 Viewed   192 Time(s)

Screenshot.png

Back to top
View user's profile Send private message 
ITSMERSH


Joined: 02 May 2018
Posts: 315

PostPosted: Wed 01 Aug 2018, 21:23    Post subject:  

This looks like you are running a LxPup or even a file manager like PCManFM. I'm not sure, though I think you can't bypass/skip this GUI.

Except: you wold create a .desktop file for it in /usr/share/applications and starting the script via this .desktop file (from menu or placed at the Desktop if possible).

_________________
RSH
Back to top
View user's profile Send private message 
davids45


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

PostPosted: Wed 01 Aug 2018, 22:26    Post subject: Backup Savefile and/or Pup partition  

G'day dcung,

In case you want to try existing packages to save your Pups from family-tinkering, you could check packages in the 'Utilities' Menu. The screenshot shows these on one of my BionicPups as pinboard icons and as Menu items (if you can read the jpg text).

There is a savefile back-up - for regular backups of just one Pup's savefile (not the read-only fixed Puppy OS files). Or before trying anything 'risky' - if you know it's risky before you do it Very Happy - that can wreck your savefile.

And a Puppy backup to mirror the Puppy partition, for when you have numerous Pups on a partition, or for your data partition(s) holding your important personal data, etc.

David S..
savepup-options-bionic.jpg
 Description   pinboard icons and Menu listed options
 Filesize   154.57 KB
 Viewed   178 Time(s)

savepup-options-bionic.jpg

Back to top
View user's profile Send private message 
ITSMERSH


Joined: 02 May 2018
Posts: 315

PostPosted: Wed 01 Aug 2018, 22:54    Post subject:  

@davids45

You got the Muppy filer running in Bionic Pup? Shocked

_________________
RSH
Back to top
View user's profile Send private message 
dcung

Joined: 13 Jul 2018
Posts: 217
Location: Down Under - 3rd rock from Sun.

PostPosted: Wed 01 Aug 2018, 22:57    Post subject: Re: Backup Savefile and/or Pup partition  

davids45 wrote:
There is a savefile back-up - for regular backups of just one Pup's savefile (not the read-only fixed Puppy OS files). Or before trying anything 'risky' - if you know it's risky before you do it Very Happy - that can wreck your savefile.


Thanks for the tips David.
I'll keep that in mind when I'm tinkering, this will fit my need.

For my relative need, the codes from rockedge suited well for the purpose.
Just want to eliminate the extra 'click' if possible... Smile
Back to top
View user's profile Send private message 
ITSMERSH


Joined: 02 May 2018
Posts: 315

PostPosted: Wed 01 Aug 2018, 23:06    Post subject:  

Quote:
Just want to eliminate the extra 'click' if possible

Just download the attached file, remove the fake .gz suffix and store it at /usr/share/applications. From that location drag and drop it onto the desktop.

Now it should bypass that extra GUI when clicked.
rockedge-restore-savefile.desktop.gz
Description 
gz

 Download 
Filename  rockedge-restore-savefile.desktop.gz 
Filesize  281 Bytes 
Downloaded  22 Time(s) 

_________________
RSH
Back to top
View user's profile Send private message 
dcung

Joined: 13 Jul 2018
Posts: 217
Location: Down Under - 3rd rock from Sun.

PostPosted: Wed 01 Aug 2018, 23:49    Post subject:  

ITSMERSH wrote:
Now it should bypass that extra GUI when clicked.


Thanks!
Back to top
View user's profile Send private message 
davids45


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

PostPosted: Thu 02 Aug 2018, 20:35    Post subject: (Off-topic) Muppy-Filer in Bionics  

G'day,

First apologies to dcung for going a little bit off-topic in his <Solved> thread Smile , but this is a reply for RSH re his posted question about my screenshot from a Bionic Pup in my above post.

I re-booted this morning into another BionicPup (peebee breeds them so quickly it's hard to keep track!) and Muppy-Filer and Sfs-Combiner do run in these 32-bit Bionics as far as I can determine (screenshot).

The little arrow at the top-corner of the pinboard icon tells me Muppy-Filer is running as an sfs-ed link from this Bionic Pup on sda1 back to the actual Muppy-Filer package on my sda5 data partition. The same for SFS-Combiner. The same 'install' set-up as my earlier Bionic screenshot as both Bionic Pups would be using the same sfs on sda1.

I cannot recall any previous problem with Muppy-Filer not running in any Puppy (Slackos, Stretches, or Ubuntu-influenced).

David S.
MuppyFiler-in-Bionic.jpg
 Description   
 Filesize   120.4 KB
 Viewed   121 Time(s)

MuppyFiler-in-Bionic.jpg

Back to top
View user's profile Send private message 
dcung

Joined: 13 Jul 2018
Posts: 217
Location: Down Under - 3rd rock from Sun.

PostPosted: Mon 13 Aug 2018, 05:58    Post subject:  

@David,

Also off-topic.
What is good about Muppy_Filer and where to get it from?

I want to have a screen like yours at some point... Smile

Thanks.
Back to top
View user's profile Send private message 
davids45


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

PostPosted: Mon 13 Aug 2018, 19:37    Post subject: Muppy Filer
Subject description: An early file manager for Puppy users
 

G'day dcung,

Muppy Filer is a file manager written, now many years ago, by an early Puppy programming expert, Mark Ulrich.
He wrote it to suit his regular programming needs in Puppy so has many functions related to writing as well as using Puppy files.

It has two panels (so not quite as good as Rox with its as-many-as-you-like windows/panels).
Muppy-Filer has numerous Puppy-related buttons to work on/with files in either panel (screenshot).

I like it particularly to navigate to a directory/file by clicking in a panel, then click on a button , e.g. 'shell' to immediately open a terminal at that location - no typing necessary, unlike using just the terminal to move to a particular file.

Muppy-Filer is over ten years old so won't work in 64-bit Pups Crying or Very sad .
It also requires two other packages, PuppyBasic and GtkBasic.
The Puppy-Basic pet is as small as Muppy-Filer.pet but the GtkBasic pet is too big for me to attach to the forum (screenshot).
These three files may be available on one of the Puppy repositories held/maintained by some forum members but I don't know for sure. Maybe one of these, if they have the three Muppy-Filer files available, could reply?

There may be other file managers that will do the same things as Muppy-Filer, but it's the program I'm now very used to, so I haven't looked elsewhere.

David S.
Muppy-Filer-panels.jpg
 Description   
 Filesize   88.37 KB
 Viewed   65 Time(s)

Muppy-Filer-panels.jpg

Files-for-Muppy-Filer.jpg
 Description   
 Filesize   47.96 KB
 Viewed   64 Time(s)

Files-for-Muppy-Filer.jpg

Back to top
View user's profile Send private message 
dcung

Joined: 13 Jul 2018
Posts: 217
Location: Down Under - 3rd rock from Sun.

PostPosted: Mon 13 Aug 2018, 20:02    Post subject:  

Thanks for taking time to explain, David.

When I have time I'll explore it.
For now I have many other tinkering to do... Smile
Back to top
View user's profile Send private message 
perdido


Joined: 09 Dec 2013
Posts: 952
Location: ¿Altair IV , Just north of Eeyore Junction.?

PostPosted: Mon 13 Aug 2018, 20:57    Post subject:  

Some internet links for the packages davids45 referenced.

Muppy-Filer (August, 31, 2008)


GtkBasic003e.pet

PuppyBasic-2.6.pet

Muppy-Filer-0.2.pet

.

_________________
Giving with an expectation for return brings misery.
Back to top
View user's profile Send private message 
dcung

Joined: 13 Jul 2018
Posts: 217
Location: Down Under - 3rd rock from Sun.

PostPosted: Mon 13 Aug 2018, 21:59    Post subject:  

Thank you perdido.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [15 Posts]  
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.0703s ][ Queries: 12 (0.0079s) ][ GZIP on ]