LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-20-2009, 01:31 PM   #1
ajpeters
LQ Newbie
 
Registered: May 2006
Posts: 5

Rep: Reputation: 0
Config save not working


I have been trying to save my tcp/ip setting in slackware using config save.

I used netconfig to set my addresses, /etc/rc.d/rc.inet1 to make active and the configsave. After each boot, when I run configsave, I get
"THe database is not created. Use /usr/bin/dbdiff makedb"

I do that and the I run configsave

I have saved to /dev/fd0
/dev/hd1
and /dev/hd2

Reboot, and my setting have gone back to the 192.168.1.1 instead of 192.168.2.188 that I want.

My OS is on /dev/hda1
 
Old 08-20-2009, 01:38 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
What *is* configsave, where did it come from?
 
Old 08-20-2009, 02:16 PM   #3
ajpeters
LQ Newbie
 
Registered: May 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Tinkster View Post
What *is* configsave, where did it come from?
A tool in slackware that save a system configuration for a cd boot.

Here is the script
umount /dev/fd0
rmdir /mnt/jaime

mount_file "$1" "$2" # save file.tgz
cp $TARINC $TARINC.X
tar -C / -czg $TARINC.X -f $CONFIGSAVE $EXCLUDE $INCLUDE
rm $TARINC.X
umount_file_if_mounted
die
;;

'restore')

mount_file "$1" "$2"

if [ -r "$CONFIGSAVE" ];
then
tar -C / -xzf $CONFIGSAVE
umount_file_if_mounted
die "restore config done."
else
umount_file_if_mounted
die "cannot read $CONFIGSAVE"
fi
;;

'makedb')
createdb
die "done creating database."
;;

'--help')
echo "dbdiff v0.99 database-based differences finder"
echo "usage: $0 (call without arguments for interactive menus)"
echo " $0 save filename|devicename"
echo " $0 restore filename|devicename"
echo " $0 makedb"
;;

*)
dialog --title "DBDIFF: save or restore changes" --menu \
"Use this dialog box to select your action.\n\
All the settings and all new or modified files from\n\
/root, /etc and /usr/local will be saved or restored.\n\n" 10 58 0 \
"save" "Save all changes against database" \
"restore" "Restore all changes against database" 2>$TMPFILE

if [ ! "$?" = 0 ]; then exit; fi

$0 `cat $TMPFILE`
rm -f $TMPFILE
;;
esac
root@cdrouter:/usr/bin# clear
root@cdrouter:/usr/bin# cat configsave
#!/bin/bash
#
# DB Diff - compare current state with the database and save only changed files
#
# License: GNU General Public License
# Author: Tomas Matejicek <http://www.slackware-live.org>
#

. /etc/dbdiff/config

function createdb()
{
echo -n "" >$TARINC
echo -n "" >$TARINC.X
tar -C / -cg $TARINC -f /dev/null $EXCLUDE $INCLUDE
}

function die()
{
if [ ! "$1" = "" ]; then echo "$1"; fi
exit
}

# select the device or filename
function mount_file()
{
if [ "$1" = "save" ]; then WORD="to"; else WORD="from"; fi

if [ "$2" = "" ]; then
dialog --title "DBDIFF: $1 changes" --inputbox \
"Enter the filename or devicename you wish to\n\
$1 your settings $WORD:\n\nexample: \n\
/dev/fd0 ... to work with your floppy drive \n\
/dev/sda1 ... to work with your USB FLASH disk \n\
/mnt/hda1/file.tgz ... to work with a regular file\n\n" 0 0 "" 2>$TMPFILE

if [ ! "$?" = 0 ]; then exit; fi

MOUNTFILE=`cat "$TMPFILE"`
rm -f $TMPFILE

if [ "$MOUNTFILE" = "" ]; then
die "You have to enter a file name or device name."
fi

else
MOUNTFILE="$2"
fi

if [ ! `echo $MOUNTFILE | grep "^/dev/"` = "" ]; then # we need to mount device
mkdir -p $MOUNTPOINT
if [ "$?" != 0 ]; then
die "cannot create directory $MOUNTPOINT"
fi

mount $MOUNTFILE $MOUNTPOINT
if [ "$?" != 0 ]; then
die "error while mounting $MOUNTFILE to $MOUNTPOINT"
fi
CONFIGSAVE="$MOUNTPOINT/$CONFIGSAVE"
UMOUNT=1
else

UMOUNT=0
if [ -d "$MOUNTFILE" ]; then
CONFIGSAVE="$MOUNTFILE/$CONFIGSAVE"
else
CONFIGSAVE="$MOUNTFILE"
fi
fi

if [ "`basename \"$CONFIGSAVE\" .tgz`" = "`basename \"$CONFIGSAVE\"`" ]; then
CONFIGSAVE="$CONFIGSAVE.tgz"
fi
}

# umount mountpoint if it is mounted by mount_file()
function umount_file_if_mounted()
{
if [ "$UMOUNT" = 1 ]; then
umount $MOUNTPOINT
rm -Rf $MOUNTPOINT
fi
}

# ==========================================================

if [ ! "`echo \"$0\" | grep configsave`" = "" ]; then
dbdiff save $1
exit
fi

if [ ! "`echo \"$0\" | grep configrestore`" = "" ]; then
dbdiff restore $1
exit
fi


if [ "$1" != "makedb" -a ! -r "$TARINC" ]; then
die "The database is not created. Use: $0 makedb"
exit
fi

case "$1" in


'save')

#
# quick fix jaime
#
mkdir /mnt/jaime
mount /dev/fd0 /mnt/jaime
rm -f /mnt/jaime/confsave.tgz
umount /dev/fd0
rmdir /mnt/jaime

mount_file "$1" "$2" # save file.tgz
cp $TARINC $TARINC.X
tar -C / -czg $TARINC.X -f $CONFIGSAVE $EXCLUDE $INCLUDE
rm $TARINC.X
umount_file_if_mounted
die
;;

'restore')

mount_file "$1" "$2"

if [ -r "$CONFIGSAVE" ];
then
tar -C / -xzf $CONFIGSAVE
umount_file_if_mounted
die "restore config done."
else
umount_file_if_mounted
die "cannot read $CONFIGSAVE"
fi
;;

'makedb')
createdb
die "done creating database."
;;

'--help')
echo "dbdiff v0.99 database-based differences finder"
echo "usage: $0 (call without arguments for interactive menus)"
echo " $0 save filename|devicename"
echo " $0 restore filename|devicename"
echo " $0 makedb"
;;

*)
dialog --title "DBDIFF: save or restore changes" --menu \
"Use this dialog box to select your action.\n\
All the settings and all new or modified files from\n\
/root, /etc and /usr/local will be saved or restored.\n\n" 10 58 0 \
"save" "Save all changes against database" \
"restore" "Restore all changes against database" 2>$TMPFILE

if [ ! "$?" = 0 ]; then exit; fi

$0 `cat $TMPFILE`
rm -f $TMPFILE
;;
esac
root@cdrouter:/usr/bin#
 
Old 08-20-2009, 06:36 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by ajpeters View Post
A tool in slackware that save a system configuration for a cd boot.
Ummm ... I've been using Slackware for *MANY* *MANY* moons,
and up till today (12.2) haven't come across that tool ... sorry,
but I'll doubt the statements validity, and ask my question again:

Where does it come from? If it were a slackware original ...
Code:
cat $( egrep -li 'bin/configsave$' /var/log/packages/* )| sed -n '1,/^FILE/p'
we might be able to tell from the output.


Cheers,
Tink
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you save Firefox's about:config? davidguygc Linux - Software 4 05-08-2007 11:13 PM
sax2 not save config for accessx lupang Linux - General 0 03-26-2005 07:51 AM
Router Does Not Save Config (javascript??) 1veedo Linux - Software 1 03-01-2005 06:20 PM
Save install config RanDrake10 Fedora 3 02-05-2005 08:38 PM
cannot download files in mozilla -save dialog not working, galeon not working cmisip Linux - General 0 08-03-2003 03:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration