Cold-Tar-Backup utility for frugal Puppy installs

Moderator: Forum moderators

Post Reply
User avatar
glene77is
Posts: 64
Joined: Thu Aug 13, 2020 7:44 pm
Location: Univ of TN, Memphis,TN,USA
Has thanked: 49 times
Been thanked: 7 times
Contact:

Cold-Tar-Backup utility for frugal Puppy installs

Post by glene77is »

.. BackUp Utility "Cold-Tar-Backup " "Cold-TarGz-Backup "
for Puppy Linux Frugal Installs

... page 5145, 3482
This page is Cold-Tar-Backup utility for frugal Puppy installs, v.4.1

Post by glene77is » Monday, Sept, 26, 2022 with revised source code notes.
CTB_4-1_exe_220926-0800.zip

CTB_4-1_exe_220926-0800 (2).zip
Cold-Tar-Backup_V4-1_executable-scripts.zip
(36.88 KiB) Downloaded 40 times

... UPDATED Current Version #4.1 dated 220926 is uploaded here :
... This version #4.1 has a custom gtk box_help routine which is more flexible than the original.
... This version #4.1 can use a /CTB_config.sh file to specify alternate tar.gz output targets.
... This version has a "alpha" exe script, which has all notes.
... This version has a "beta" exe script, "compact", which is stripped of notes ... much smaller.

V#4.1:Download the Cold-Tar-Backup executable BASH script, "run", and read the "Help" page-out.
V#4.1: current file is also available at http://www.GeoCities.WS/glene77is/
V#4.1:On my website, on the "front page" click this label : "Linux Page" for the GC_Linux.html

"CTB"
...is our Puppy Backup for Frugal saveDATA
"PUPSTATE"
...controls the program parameters.[/color
"CTB"
...will generate a 'saveDATA.tar.gz' with and your custom name , tagged with "Date-Time-Seconds". [/color
...will generate a standard '.tar.gz' backup [/color
...for saveFOLDER or saveFILE.4fs[/color
...for Official Puppy Frugal Systems.[/color
"CTB"
...will place the generated output file "saveDATA-DTS.tar.gz" "local" to the source data.
...can use a /CTB_config.sh file to specify alternate tar.gz output targets. Read HELP page.
...

...
"CTB" has option to scan list of 8 mounted drives sda1 thru sdh1
... to copy the saveDATA.tar.gz into '/CTB_Backup_' . List is user modifiable in source code.
...
"CTB"
... is written only with lots of BASH script .
...... We use some common gtk dialog-boxes v.8, and xmessage boxes.
...... Both gtk routines are included in all Official Puppy OS .

"CTB"
... has tool-tips on front screen main buttons.
... has option for small "HELP" display.
... has option for PeeBee Legal Dump to screen.

"CTB"
... has many more notes in the "HELP" tab page.
... So, Run the CTB script and read the "HELP" tagged page.
... Then Open the (KOSHER) Source Code to see how it's done.

CTB_Screens_All_sample_220310.jpg
CTB_Screens_All_sample_220310.jpg
CTB_Screens_All_220310.jpg (142.2 KiB) Viewed 754 times

Cold-Tar-Backup utility for frugal Puppy installs
"Cold-Tar-Backup" v.4.1

To restore: ''XArchive', will 'Extract all' from
the saveDATA-CTB---tar.gz file.

Our Design Philosphy is: .
(1) I.T. documented coding,
(2) readable/modular coding,
(3) modifiable coding.

&&&

&&&

Produces a '.tar.gz' output file.
Very Standard ... just 'tar' into 'gzip' ...
just like in 1975, the UNIX Tape-ARchive.
Not spectacular, but guaranteed.

Features for Puppy Linux Backup :
(1) "CTB" creates a 'tar.gz' backup
. . . with filename plus 'y-m-d-s'
. . . date-time-seconds stamp.
. . . saved in the Source directory, default.
(2) "CTB" automatically selects fast compression.
(3) "CTB" runs OK on 32/64-bit Frugal SaveFOLDER installs
... in EXT2/3/4 hard-drives and Flash-Drives.
(4) "CTB" runs OK on 32/64-bit Frugal SaveFILE.4fs installs
... in EXT2/3/4 hard-drives and Flash-Drives.
(5) "CTB" is controlled by the "/etc/rc33.d/PUPSTATE" file.
(6) "CTB" handles any System "home" location
... by using Barry Kauler calculation code (described in 'source code').
(7) "CTB" can scan list of 8 mounted hard-drives sda1 thru sdh1
... to copy the saveDATA.tar.gz into '/CTB_Backup_' .

Version 4 has customized and embedded gtkdialog code
for some of the gtkdialog/box_ and a "config file" .
#(: dependency on these two standard Puppy programs :
#(: gtkdialog version 0.8.4 release (C) 2003-2007 Laszlo Pere, 2011-2012 Thunor
#(: Built with support for: GTK+ 2, Glade.
#(: gxmessage-2.12.4
#(: Copyright (C) 2009 Timothy Richard Musson

...
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
If you have a problem, try using the "private mail" option at the top of Murga page.
If you have a problem, please remember that this is BASH,
....... BASH is not perfect, and BASH has Quirks .
A better language might be Python, Pascal or Fox(Unix),
but our projects [ CTB , MGN, B2R, C3C, S2F, et al ] have given us a chance to explore BASH.

.......

"We" are small, only one now, and I retired 28 years ago from our university.
.......
I have gone riding my bicycle today.
I may simply ride my bicycle off into the "sun-set of Time".
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Last edited by glene77is on Mon Sep 26, 2022 8:43 am, edited 40 times in total.

*Just an old Apprentice caught Tinkering in the Master's WorkShop. *
Glen Ellis ( ͡° ͜ʖ ͡° ) K4KKQ , Electronic Engineering :ugeek:
Website: http://www.GeoCities.WS/glene77is :thumbup2:
Electrical Science , Memphis, TN
Top

..

Attachments
CTB_main-screen-displays-sample.jpg
CTB_main-screen-displays-sample.jpg
CTB_Screens_All_220310.jpg (141.7 KiB) Viewed 440 times
CTB running in BASH terminal expose display.jpg
CTB running in BASH terminal expose display.jpg
CTB_Terminal_01.jpg (141.75 KiB) Viewed 893 times
Last edited by glene77is on Thu Aug 01, 2024 2:56 pm, edited 69 times in total.

*Just an old Apprentice caught Tinkering in the Master's WorkShop. *
Glen Ellis ( ͡° ͜ʖ ͡° ) K4KKQ , Electronic Engineering :ugeek:
Website: http://www.GeoCities.WS/glene77is :thumbup2:
Electrical Science , Memphis, TN

user1111

Re: Cold-Tar-Backup utility for frugal Puppy installs

Post by user1111 »

Thanks glene77is

Your first and only posting. Hello.

I don't tend to use save files/folders for data. Only just for saving system configuration changes. So mostly I boot, use, shutdown without saving.

Store data on HDD, main data in one partition, backups stored in another partition, where I use rsync to 'duplicate' the data and where that also creates a tar file of changed/new files since the last backup.

The first time rsync and tar runs it is slow as it duplicates/tar's everything, but subsequent runs usually run through in seconds. Move the tar files offline/elsewhere and data is recoverable. System files are easily 'recovered' as well - just re-download/install afresh. Along with a backup copy of your savefile/folder backed up and you can at least get back to where you were the last time you ran a backup (and if backups run through quickly/easily you can do that often).

The core code I'm using ... (but there are loads of other Puppy etc. backup utilities).
.

Code: Select all

if [ $# -lt 1 ] ; then
  echo "rsync wrapper so that there is a new snapshot tarball"
  echo "created per every run. Unmodified files are hard-linked"
  echo "to previous backup"
  echo
  echo "Usage:"
  echo "  $0 <source>"
  echo
  echo "Where:"
  echo "  source        - the directory to be backed up as accepted by rsync"
  echo "                  (local or remote)"
  exit
fi

TMPFILE=$(mktemp) || exit 1

src=$1
dst=$PWD

for p in $( rsync $dst/ | grep -oE '[0-9]{4}(\.[0-9]{2}){2}_[0-9]{2}(\.[0-9]{2}){2}' | tail -5 ) ; do
  linkPrev="--link-dest=../$p $linkPrev"
done

if [ "$OS" = "Windows_NT" ] ; then
  fixperm='--chmod=ug=rwX --chmod=o=rX'
fi

d=$( date +'%Y.%m.%d_%H.%M.%S' )
echo "Scanning files/folders"
rsync -av -i $linkPrev $fixperm "$src/" "$dst/$d" | grep '^>' | awk -v src="$src/" '{ first = $1; $1 = "";gsub("^ ","");print src$0 }' | tee $TMPFILE || exit 1

if [ -s $TMPFILE ]; then # file has some data ?
	echo "Preparing tar file"
	{ tar -c -T $TMPFILE -f tar.tar ; } 2>/dev/null
else
	echo "No changes found, not creating tar file"
fi

# remove older backup folders
mv ${dst}/${d} abc123
ls | grep -oE '[0-9]{4}(\.[0-9]{2}){2}_[0-9]{2}(\.[0-9]{2}){2}' >$TMPFILE
cat $TMPFILE | xargs rm -rf
mv abc123 ${dst}/${d}
rm $TMPFILE
# Set tar file to a timestamp type format, but not one that might
# conflict (be picked up) as a rsync folder
d=$( date +'%a_%d_%b_%Y_%M:%H' )
if [ -f ${dst}/tar.tar ]; then 
	mv ${dst}/tar.tar ${dst}/tarfile_$d.tar 
fi
User avatar
glene77is
Posts: 64
Joined: Thu Aug 13, 2020 7:44 pm
Location: Univ of TN, Memphis,TN,USA
Has thanked: 49 times
Been thanked: 7 times
Contact:

Re: Cold-Tar-Backup utility for frugal Puppy installs

Post by glene77is »

Cold-Tar-Backup ... utility for frugal Puppy installs
Post by glene77is » Wed Aug 26, 2020 10:32 am
.. Has been upgraded to V.4.1.
posted on : viewtopic.php?t=5145
...
Cold-Tar-Backup utility for frugal Puppy installs, v.4.1

I have reviewed your source code. Interesting approach. Different perspective.

This is not my "first and only posting". The world of technology is exceedingly large !.
My background (40yrs) was largely "SQL" and commercial apps , and electronic design
as listed on my website, and listed on ResearchGate.Net.

Last edited by glene77is on Thu Aug 01, 2024 1:43 pm, edited 5 times in total.

*Just an old Apprentice caught Tinkering in the Master's WorkShop. *
Glen Ellis ( ͡° ͜ʖ ͡° ) K4KKQ , Electronic Engineering :ugeek:
Website: http://www.GeoCities.WS/glene77is :thumbup2:
Electrical Science , Memphis, TN

user1111

Re: Cold-Tar-Backup utility for frugal Puppy installs

Post by user1111 »

glene77is wrote: Mon Sep 21, 2020 11:57 pm RufWoof,
Thanks for the interesting code sample.
Will peruse and learn from it.
My background (40yrs) was largely "SQL" and commercial apps
as listed on my website.
My ventures into BASH have not been so fruitful.
Hi Glen.

Brings back memories of three legged transistors, resonant circuits etc. And JCL. In my professional computing career I started out on Honeywell DPS6's then progressed onto IBM and Amdahl mainframe clusters, writing Cobol and a SQL like CSP database query language. First ventures however before that as a 'hobby' was writing pure assembler on Sinclair Spectrums, literally hex coding, and as a kid assembling electronic Maplins projects such as crystal radios.

I've forgotten so much however, that my scripting skills are now amateur at best. Think all of the solder fumes and throwing around bags of asbestos in 'flour fights' in my younger years are taking it toll. Recently turned 60 and my eyesight is blurred and my might is ever forgetful.
User avatar
glene77is
Posts: 64
Joined: Thu Aug 13, 2020 7:44 pm
Location: Univ of TN, Memphis,TN,USA
Has thanked: 49 times
Been thanked: 7 times
Contact:

Re: Cold-Tar-Backup utility for frugal Puppy installs

Post by glene77is »

You are invited to check my website, to see how I explored the many facets of narrow pass-band resonant audio filters,
and then turned to 'non-resonant' 'phase-filtering' and "dual-non-resonant-notches" for narrow pass-bands,
which are published via ResearchGate.Net, with 20K hits and 350 downloads. Hard-Core academic research. .

*Just an old Apprentice caught Tinkering in the Master's WorkShop. *
Glen Ellis ( ͡° ͜ʖ ͡° ) K4KKQ , Electronic Engineering :ugeek:
Website: http://www.GeoCities.WS/glene77is :thumbup2:
Electrical Science , Memphis, TN

Post Reply

Return to “Utilities”