Pbackup 3.1.9-1
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.
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.
-
- Posts: 295
- Joined: Sat 03 Dec 2005, 11:30
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...
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...
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.
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.
-
- Posts: 295
- Joined: Sat 03 Dec 2005, 11:30
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.
This script is called from this smaller script, which is called from rc.local on startup:
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.
The main script that does the backing up - doesn't use cron, just sleeps for 60 seconds between back ups - is below.
Code: Select all
#!/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
Code: Select all
#!/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
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.
-
- Posts: 286
- Joined: Tue 16 Aug 2005, 03:47
- Location: Appalachian Mountains
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.
When I hit OK and exit the program the files are not there.
I am using the compress option.