Backup Feature for user profiles/Data
-
Hi All,
just to let you know i’ve successfully been able to backup users profile before imaging.
FOG takes a direct copy of doc and settings (xp) or users (win7/8) - images the machine then pulls the backup back down to the newly machine under root C:\MachineName-UserBackup
helps not to lose data if no folder redirection is setup. if anyone interested i can post the mods you need to make to the init.gz…
also if considered for main fog code was thinking maybe have a tick box under host to say whether to choose whether to backup or not. thoughts?
-
.
-
I have no particular use for this in the work environment as we use roaming profiles here but this sounds very positive for maybe home or small office setups… something that should be looked at in more depth definately. It sounds like it would be a marvelous option to have from the web control panel. Good work.
-
Is this done in the FOG client or in the FOG code in init.gz?
-
FOG Code in the init
-
[quote=“Lee Rowlett, post: 11887, member: 28”]FOG Code in the init[/quote]
I would very much like to know the mods! This is exactly what I’ve been looking to do.
-
And BTW, would love the ease of the tick box operation if considered for FOG code!
-
it needs a little work but edit fog file within init.gz and add this code (you will need to create a folder on the server “/images/Backup”
and just add /amend every instance of:
[CODE]echo -n " * Waiting for disks to settle…";[/CODE]
to
[CODE]echo -n " * Waiting for disks to settle…";
echo “Done”;
echo -n " * Preparing users backup location…";
mkdir /ubackup
mount -o nolock,proto=tcp ${storage}Backup /ubackup
macWinSafe=
echo $mac | sed 's/://g'
;tmpuBackupPath=“/ubackup/$macWinSafe”;
if [ ! -d “$tmpuBackupPath” ]
then
mkdir -p “$tmpuBackupPath” 2>/dev/null;
fi
chmod -R 777 $tmpuBackupPath
rm -rf “$tmpuBackupPath/*”
parts=
fogpartinfo --list-parts $hd 2>/dev/null
;for prt in $parts
do
win7partcnt=
expr ${win7partcnt} + 1
;done
if [ “$win7partcnt” = “1” ]; then
part=“/dev/sda1”;
elif [ “$win7partcnt” = “2” ]; then
part=“/dev/sda2”;
elif [ “$win7partcnt” = “3” ]; then
part=“/dev/sda3”;
fi
echo “Done”;
echo -n " * Backing up user data…";
mkdir /ntfs &>/dev/null
ntfs-3g -o force,rw $part /ntfs
if [ “$type” = “down” -a “$osid” = “1” ]; then
mkdir -p ${tmpuBackupPath}/“Documents and Settings” 2>/dev/null;
chmod -R 777 ${tmpuBackupPath}/“Documents and Settings”
cp -rf /ntfs/“Documents and Settings/”* ${tmpuBackupPath}/“Documents and Settings” 2>/dev/null;
else
mkdir -p “${tmpuBackupPath}/Users” 2>/dev/null;
chmod -R 777 ${tmpuBackupPath}/Users
cp -rf /ntfs/Users/* ${tmpuBackupPath}/Users 2>/dev/null;
fi
echo “Done”;
umount /ubackup;
umount /ntfs;
[/CODE] -
so now need to pull the data back down after imaging done so then after:
echo " * Database updated!";
echo “”;
fi
clearScreen;add this:
[CODE]echo -n " * Mounting users backup location…";mkdir /ubackup
echo “Done”;
mount -o nolock,proto=tcp ${storage}Backup /ubackup
echo -n " * Downloading user data backup…";
mkdir -p /ntfs/UserBackup 2>/dev/null;
mv ${tmpuBackupPath}/Users /ntfs/UserBackup
rm -rf /ubackup/*
echo “Done”;
[/CODE] -
Can you update your posts above to use the CODE tags around the code, and if possible include approximate line numbers of where to begin?
Awesome job.
-
I’m pretty new to this whole thing. I’ve got my system up and running and would like to add this as a feature but I’m unsure how to edit the init.gz code. I pulled down /tftpboot/fog/images/init.gz and unzipped it but I cant find the code that I am supposed to edit. I assume that means I have grabbed the wrong init.gz but I’m not sure which one I should be grabbing. Any help would be greatly appreciated.
-
sysfs,
You also have to mount it.
The gzip is ext2 formatted file/filesystem.
The way you edit is to perform these tasks:
First unzip, as you already know how but just for clarity sake:
[code]cd /tftpboot/fog/images
gunzip init.gz[/code]Then make another directory and mount it like a filesystem:
[code]mkdir tmp
mount -o loop init tmp
[/code]Then cd into the tmp folder and you’ll see all the scripts and the “Root” filesystem fog uses. Most of the scripts are in the bin folder so:
[code]
cd tmp/bin
[/code]Then you can edit all the scripts you need to.
When you’re all complete perform these tasks:
[code]
cd /tftpboot/fog/images
umount tmp
gzip -9 init
[/code]You should, then, have successfully customized your init.gz file.