The time now is Fri 13 Dec 2019, 18:22
All times are UTC - 4 |
Author |
Message |
Gn2

Joined: 16 Oct 2006 Posts: 936 Location: virtual - Veni vidi, nihil est adpulerit
|
Posted: Sun 31 Dec 2006, 02:23 Post subject:
|
|
A suggestion - Use cron to sync or backup as needed.
No need to backup all - just the changes.
Use (diff) in any script.
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6609 Location: Valåmoen, Norway
|
Posted: Sun 31 Dec 2006, 11:45 Post subject:
|
|
Thanks for info, shankargopal.
Your methode sounds interesting, and I'll put it into the manual. (will be made some time before 1.0).
But I wonder if PuppyBackups filetree fits your needs. PuppyBackup with mirrorfunction makes the path '/any_savepath/mirrordir1/*'. The mirrordir directory are made, so user knows that this is not original files. In your case maybe the mirrordir directory will come in your way. Maybe it should not been there at all.
|
Back to top
|
|
 |
shankargopal
Joined: 03 Dec 2005 Posts: 295
|
Posted: Mon 01 Jan 2007, 01:55 Post subject:
|
|
zigbert,
I'm a little confused - I haven't actually used either PuppyBackup or PuppyMirror, preferring to stick for the moment to my script. So not sure if that directory would get in the way or not - though I don't see why it should. My method is basically this:
1. On the systems where I want to back up, I create an image file with an ext2 filesystem (named pupback.bak) on a suitable partition.
2. Run small script at start up to check all possible hard drive partitions for such an image file.
3. If such an image file exists, mount it every xx seconds (after an initial delay to give possibility of restoring backup if need be) and rsync it with certain directories as specified in a config file.
4. Ensure during shutdown that a final mirror is done.
That's it, really. I can post my makeshift script if you'd like, though I'm embarassed at showing it to any of y'all...
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6609 Location: Valåmoen, Norway
|
Posted: Mon 01 Jan 2007, 08:24 Post subject:
|
|
shankargopal
If I understand you right, we are talking about a kind of "realtime" backup. Every backup system should have that feature, shouldn't it? In basic, that is not too difficult to put into existing PuppyBackup. The challenge is more how to set things up in existing GUI. We are now talking about a mix of PuppyBackup and crontab, and I try to keep focus on an easy-to-use backup. But in some future, like a flash from nowhere, everything seems clear. (Or, the other way - someboby posts a brilliant soultion on the Puppy forum)
Please show your script, show all of them...feedback is how we learn. Since my script can't do this task, your script could be a solution for others, or be an example of how to expand usage of PuppyBackup. That could be a part of the coming manual.
|
Back to top
|
|
 |
shankargopal
Joined: 03 Dec 2005 Posts: 295
|
Posted: Mon 01 Jan 2007, 23:04 Post subject:
|
|
Sigh, here it is...
The main script that does the backing up - doesn't use cron, just sleeps for 60 seconds between back ups - is below.
Code: |
#!/bin/bash
if [ ! -f /root/.PUPBKDRV ]; then
echo "ERROR. Could not locate .PUPBKDRV"
else
COUNT=0
while [ 1 -eq 1 ]; do
# This if statement allows calling program to specify an initial delay or have this be a "final" run
# i.e. just one run and then exit
if [ "$COUNT" -eq 0 ] && [ "$1" != "" ]; then
if [ $1 != "final" ]; then
sleep $1
else
echo "Final backup running..."
fi
else
sleep 60
fi
echo junga > /tmp/backup.running
BACKPART="`cat /root/.PUPBKDRV`"
BACKPARTFS="`probepart | grep $BACKPART | cut -f 2 -d "|"`"
if [ ! $BACKPARTFS = "" ]; then
[ ! -e /mnt/pupback ] && mkdir /mnt/pupback
MOUNTED="`mount | grep $BACKPART | cut -f 3 -d " "`"
if [ "$MOUNTED" = "" ]; then
mount -t $BACKPARTFS $BACKPART /mnt/pupback
if [ ! $? -eq 0 ]; then
echo "Failed to mount backup partition"
exit
fi
MOUNTED="/mnt/pupback"
fi
[ ! -e /mnt/backdatafile ] && mkdir /mnt/backdatafile
mount -o loop -t ext2 $MOUNTED/pupback.bak /mnt/backdatafile
if [ $? -eq 0 ]; then
echo "+++++++++++++++++++++++++++"
echo "Starting Backup at"
date
DIRS="`cat /root/.BACKDIRS | tr "\n" " "`"
if [ ! "$DIRS" = "" ]; then
for DIR in $DIRS; do
ACTDIR="`echo $DIR | sed -r "s/^\///" | sed -r "s/\/$//"`"
if [ ! -e /mnt/backdatafile/$ACTDIR ]; then
PATHSPLIT="`echo $ACTDIR | sed -r "s/\// /g"`"
TOTPATH=""
for PATHS in $PATHSPLIT; do
TOTPATH="$TOTPATH/$PATHS"
mkdir /mnt/backdatafile/$TOTPATH
done
fi
rsync -a -v --delete /$ACTDIR/ /mnt/backdatafile/$ACTDIR/
done
else
echo "Can't find /root/.BACKDIRS"
fi
sync
umount /mnt/backdatafile
sleep 3
[ "$MOUNTED" = "/mnt/pupback" ] && umount /mnt/pupback
else
echo "Could not mount backup file"
fi
else
echo "Could not locate backup partition"
fi
rm /tmp/backup.running
echo "==========================="
let "COUNT+=1"
if [ $1 = "final" ]; then
exit
fi
done
fi
|
This script is called from this smaller script, which is called from rc.local on startup:
Code: |
#!/bin/bash
POSSPART=`probepart | grep --extended-regexp "vfat|msdos|ext2|ext3|ntfs" | grep --extended-regexp "hda|sda" | cut -f 1 -d "|" | tr "\n" " "`
if [ ! "$POSSPART" = "" ];then
echo "Searching for pupback.bak on $POSSPART"
killall pupbacker.sh 2> /dev/null
for PARTI in $POSSPART; do
echo "Checking on $PARTI..."
if [ -e /mnt/pupback ]; then
umount /mnt/pupback 2> /dev/null
else
cd /mnt
mkdir pupback
fi
PARTFS=`probepart | grep $PARTI | cut -f 2 -d "|"`
mount -t $PARTFS $PARTI /mnt/pupback
if [ $? -eq 0 ]; then
if [ -e /mnt/pupback/pupback.bak ]; then
echo "Detected pupback.bak on $PARTI"
echo -n "Checking if pupback.bak can be mounted..."
if [ -e /mnt/backdatafile ]; then
umount /mnt/backdatafile 2> /dev/null
else
cd /mnt
mkdir backdatafile
fi
mount -t ext2 -o loop /mnt/pupback/pupback.bak /mnt/backdatafile
if [ $? -eq 0 ]; then
echo "success"
umount /mnt/backdatafile
umount /mnt/pupback
echo $PARTI > /root/.PUPBKDRV
echo "Starting PupBacker..."
/root/Software/pupbacker.sh 300 > /root/Software/backup.log 2> /root/Software/backup.log &
echo "YOU HAVE FIVE MINUTES TO RESTORE ANY BACKUP.TO GET MORE TIME, KILL pupbacker.sh"
exit
else
echo "FAILED to mount pupback.bak."
umount /mnt/backdatafile
umount /mnt/pupback
fi
fi
umount /mnt/pupback
fi
done
echo "Failed to find pupback.bak"
else
echo "Could not find any suitable partitions for backups"
fi
|
Finally, Ihave edited rc.shutdown to check if pupbacker is running, and if so to wait until it completes, or else to call "pupbacker.sh final".
I know there are a lot of hamhanded bits in both scripts, but please note I was writing with a lot of inexperience... this was almost a year ago.
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6609 Location: Valåmoen, Norway
|
Posted: Thu 04 Jan 2007, 02:33 Post subject:
|
|
version 0.7, see mainpost.
shankargopal.
Thank you for sharing your scripts.
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6609 Location: Valåmoen, Norway
|
Posted: Sat 06 Jan 2007, 21:26 Post subject:
|
|
Version 0.8. See main post.
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6609 Location: Valåmoen, Norway
|
Posted: Tue 09 Jan 2007, 14:06 Post subject:
|
|
Version 0.9. See main post.
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6609 Location: Valåmoen, Norway
|
Posted: Tue 16 Jan 2007, 16:45 Post subject:
|
|
version 0.9.4. See main post.
Now I really need testers.
|
Back to top
|
|
 |
MU

Joined: 24 Aug 2005 Posts: 13647 Location: Karlsruhe, Germany
|
Posted: Tue 16 Jan 2007, 21:33 Post subject:
|
|
0.9.4 already... you're just too fast
Currently uploading Muppy 007 with Puppybackup 0.9.0.
But I did not test it myself yet.
Mark
|
Back to top
|
|
 |
brad_chuck
Joined: 15 Aug 2005 Posts: 284 Location: Appalachian Mountains
|
Posted: Tue 16 Jan 2007, 22:38 Post subject:
help |
|
The program looks good. When I backup to hardrive from /root/my-documents/School to /root/backup . the files show up then when the "show backup files are in the dir" comes up.
When I hit OK and exit the program the files are not there.
I am using the compress option.
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6609 Location: Valåmoen, Norway
|
Posted: Wed 17 Jan 2007, 06:42 Post subject:
|
|
thank you, brad_chuck
Bug is fixed for next release. A workaround is to copy/move the *.tgz file before closing 'finished box'.
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6609 Location: Valåmoen, Norway
|
Posted: Wed 17 Jan 2007, 12:33 Post subject:
|
|
version 0.9.5. See main post.
MU, do you follow
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6609 Location: Valåmoen, Norway
|
Posted: Sat 20 Jan 2007, 04:58 Post subject:
|
|
version 0.9.6. See main post.
|
Back to top
|
|
 |
MU

Joined: 24 Aug 2005 Posts: 13647 Location: Karlsruhe, Germany
|
Posted: Sat 20 Jan 2007, 11:34 Post subject:
|
|
Zigbert, did you forget to attach it?
Or am I getting old and blind?
Thanks, Mark
|
Back to top
|
|
 |
|
|
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
|