Dear all I am trying to use Yast’s backup to backup my /home directory.
I have the following partitions ready
/home with 95Gb free
/ with 54 GB free
/media/disk with 450GB free
I want the backup of my home to be stored in /media/disk (that will be used only for storing my backups.)
After opensuse finds the files that needed to be backed up (with a total of 110GB) give me the warning /tmp might not have enough space to store the backup.
What should I do ? I have configured opensuse to store my backup in the right disk /media/disk that has space. It seems that opensuse uses /tmp to save the backup there.
i use a rsync based backup for /home. This is the best method i found for this.
#!/bin/bash
DATE=$(date +%F)
LOGFILE="$HOME/.backup_$USER.log"
if -f $LOGFILE ]
then
cat /dev/null > $LOGFILE
else
#fixing the exclude patterns
#without this line the script is likely to fail
touch $LOGFILE
fi
/usr/bin/rsync -rtpogv --delete -clis --exclude=*.vdi --exclude=.backup_*.log --log-file=$LOGFILE $HOME/ /mnt/media/Backup/home_$USER/
SUCCESS=$?
if $SUCCESS -ne 0 ]
then
echo -e "$USER
your backup failed. rerun manually" | mail -s "weekly backup failed on $DATE" $USER
else
echo -e "$USER
your backup has finished. Details can be found in $LOGFILE" | mail -s "weekly backup with rsync finished on $DATE" $USER
fi
exit 0
for the system backup i use the yast tool and added a automatic backup with this post installation script:
#!/bin/bash
DATE=$(date +%F)
#delete Backups which are older than 14 days
find /mnt/media/Backup/system/ -ctime +14 -name "system-full*" -delete
#rename the backup
mv system-full.tar system-full-$DATE.tar
mv system-full.xml system-full-$DATE.xml
> After opensuse finds the files that needed to be backed up (with a
> total of 110GB) give me the warning /tmp might not have enough space to
> store the backup.
No, it can not save the temporary files while creating the archive. YaST
backup is not designed for large home backups.
I have not used the tool recently, see if you change the temporary files
path. If not, you could consider that as a bug.
–
Cheers / Saludos,
Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)
yes i basicly rsync the complete users home, thus i do not have to restore my settings if i have installed the same packages after a restore.
forget about that script. does’nt work with cron though. the whole yast2 backup tool is messed up. so i unfortunately must do this by hand every week. which enoys me.
@l1zard
Why not place your rsync commands into a shell program and run it as a cron job?
♯#
Crontab -e
Every Thursday at 1145 pm run /home/l1zard/rsync_home.sh
45 23 * * 4 sh /home/l1zard/programs/rysnc_home.sh
#!/usr/bin
file /home/l1zard/programs/rysnc_home.sh
rsync commands to back up all of /home/l1zard/ follow:
Using programs in a /home/l1zard/programs folder minimizes the need to update the cron tables, and you can change the programs run by root without being superuser.
On multi-user PCs, you’d put programs intended to be run by superusers into protected superuser only folders.
maybe i wasn’t clear about this in the first place. I DO USE my scripts along side with cron. i have also a script for restore users home. Both scripts are located at /usr/sbin.
there are many tasks to get a backup done. however the advantage of using the yast tool is that this will backup a list of packages you have currently installed in your system, files that have been modified or are not belonging to any package will also be saved. This keeps the backup simple and small. I see no need to backup files which are belonging to packages. Unfortunately i don’t know any tool that would accomplish this task too.
OT: i am currently writing a script that gets all packages currently installed in the system in tar.gz archive. Is there any way to only download the packages which are not already in zyppers cache. Because when connection with the server gets interrupted the script has to start all over agian. would help if someone has an idea.
On 2011-04-15 04:06, l1zard wrote:
> I see no need to backup files which are belonging to
> packages. Unfortunately i don’t know any tool that would accomplish this
> task too.
I wrote my own script years ago that did what yast did. I could dig it out.
–
Cheers / Saludos,
Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)
On 2011-04-15 21:06, l1zard wrote:
>
> oh this would be very nice of you thanks
>
>
I used this code to find out what YaST did (around 2002):
(Remove leading “>”, it is a side efect of bypassing Thunderbird wraplines)
Code:
> #!/bin/sh
>
> terminal=tty5
>
> while true ; do
>
> ps -t$terminal f > WatchYast.log_1
> if ! cmp --silent WatchYast.log_1 WatchYast.log_2 ; then
> set date "+%x %X"
> echo “" $1 $2 >> WatchYast.log
> echo "” $1 $2
> cat WatchYast.log_1 >> WatchYast.log
> cp WatchYast.log_1 WatchYast.log_2
> cat WatchYast.log_1
> fi
> sleep 1
> done
bck.rpm script (2002)
This script just creates listings of candidates for backup. Part of my testing.
(Remove leading “>”, it is a side efect of bypassing Thunderbird wraplines)
Code:
> #!/bin/bash
>
> # I want to get a list of all files which came from an installation package,
> # so as not to backup them, as they are on the original CDs
> # (bck.rpmcheck.packlst). I also want to get a list of the same files, but
> # those which have been modified, because these I do want to backup them
> # (bck.rpmcheck.different)
> #
> # At the same time, I might as well save package list.
>
>
> rpm --all --query --list > /root/tmp/bck.rpmcheck.filelist &
> rpm --all --query > /root/tmp/bck.rpmcheck.packlst &
> rpm --all --verify --nomd5
> | tee /root/tmp/bck.rpmcheck.not-verify
> | sed -n ‘s/^S.* ///p;s/^…T.* ///p’ > /root/tmp/bck.rpmcheck.different &
> wait
>
>
>
> # Yast did this, but I believe rpm sintaxis has changed a little:
> # rpm --dbpath /var/lib/rpm -V ldp --nodeps --noscripts --nomd5
> # ^^^ el paquete. creo que es mejor simplemente --all
> # sed -n ‘s/^S.* ///p;s/^…T.* ///p’ >/tmp/YaST.tdir/stp287_525_S 2>/tmp/YaST.tdir/stp287_525_E
> #
>
>
> # The general form of an rpm verify command is
> #
> # rpm -V|-y|–verify [verify-options]
> #
> # Verifying a package compares information about the installed files in the package with information about the
> # files taken from the original package and stored in the rpm database. Among other things, verifying com255
> # pares the size, MD5 sum, permissions, type, owner and group of each file. Any discrepencies are displayed.
> # The package specification options are the same as for package querying.
> #
> # Files that were not installed from the package, for example documentation files excluded on installation
> # using the “–excludedocs” option, will be silently ignored.
> #
> # Options that can be used in verify mode:
> #
> # --nofiles
> # Ignores missing files when verifying. No funciona.
> #
> # --nomd5
> # Ignores MD5 checksum errors when verifying.
> #
> # --nopgp
> # Ignores PGP checking errors when verifying.
> #
> # --nofiles
> # Ignores missing files when verifying.
> #
> # The format of the output is a string of 8 characters, a possible “c” denoting a configuration file,
> # and then the file name. Each of the 8 characters denotes the result of a comparison of one attribute
> # of the file to the value of that attribute recorded in the RPM database. A single “.” (period) means
> # the test passed. The following characters denote failure of certain tests:
> #
> # 5 MD5 sum
> #
> # S File size
> #
> # L Symlink
> #
> # T Mtime
> #
> # D Device
> #
> # U User
> #
> # G Group
> #
> # M Mode (includes permissions and file type)
> #
backup - 2006 version
(Remove leadings “>”, it is a side efect of bypassing Thunderbird wraplines)
Code:
> #!/bin/bash
>
> # Carlos E. R.
> # fidonet, 2:341/14.70
> # This is free software, GPL.
>
> # Do a backup of modified files belonging to rpms,
> # downloaded updates, and tgz to be compiled (from cer)
>
> # requires zisofs and patched mkisofs
>
> # problems.
> # - file lists must care for spaces in the names.
> # - on the fly needs to create dirs with the same permissions and ownerships.
>
>
> DESTINO_CPY=/backup/copia.rpmbackup
> DESTINO_CMP=/backup/rpmbackup.cmp
> DESTINO_ISO=/backup/rpmbackup.iso
> COUNT_DIR=0
> COUNT_FILE=0
> BASENAME=basename $0
>
>
> LISTOFALLFILESINRPMS=/root/bin/bck.rpmcheck.filelist
> LISTOFALLRPMS=/root/bin/bck.rpmcheck.packlst
> LISTOFNOTVERIFIEDFILESINRPMS=/root/bin/bck.rpmcheck.not-verify
> LISTOFMODIFIEDILESINRPMS=/root/bin/bck.rpmcheck.different
> LISTOFFOUNDFILES=/root/bin/bck.find.find
> LISTOFUNIQUEFILES=/root/bin/bck.find.unique
> LISTOFALLPATHSTMP=/root/bin/bck.paths.tmp
> LISTOFALLPATHS=/root/bin/bck.paths
> LISTOFLISTS="$TOFMODIFIEDILESINRPMS $LISTOFALLFILESINRPMS $LISTOFALLRPMS $LISTOFNOTVERIFIEDFILESINRPMS $LISTOFMODIFIEDILESINRPMS $LISTOFFOUNDFILES $LISTOFUNIQUEFILES $LISTOFALLPATHS"
>
> # Any file in these paths that does not belong to any rpm, will be backed up.
> EXTRAPATHSTOBACKUP="/etc /usr /var /bin /sbin /boot /lib /opt /root /home /cripta /xtr /www"
>
> #extra backup pruebas
>
>
> # get the paths for programs we are going to use a lot; I hope that should save some time
> mkdir_=which mkdir
> cp_=which cp
> dirname_=which dirname
> mkdirhier_=which mkdirhier
> mkzftree_=which mkzftree
> #=which
>
> for FILES in $mkdir $cp_ $dirname_ $mkdirhier_ $mkzftree_
> do
> if ! test -x $FILES ; then
> echo “At least one of the needed programs have not been found; aborting.”
> echo “It will be one of: mkdir cp dirname mkdirhier mkzftree”
> exit 3
> fi
> done
>
>
>
> function test_dest_compressed()
> {
> if test -d $DESTINO_CMP ; then
> #echo “El directorio destino $DESTINO_CMP existe, debes borrarlo manualmente.”
> echo “Destination directory $DESTINO_CMP exists, you must delete it manually.”
> exit 1
> fi
> }
>
> function test_dest_iso()
> {
> if test -d $DESTINO_ISO ; then
> #echo “El fichero de imagen de destino $DESTINO_ISO existe, debes borrarlo manualmente.”
> echo “Destination ISO image file $DESTINO_ISO exists, you must delete it manually.”
> exit 2
> fi
> }
>
> function CheckFileExistsOrAbort ()
> {
> if ! test -f $1 ; then
> echo “Needed file $1 does not exist: it is created with the rpm option.”
> exit 4
> fi
> }
>
>
>
> function CompressLists()
> {
> for FILES in $LISTOFLISTS
> do
> gzip $FILES
> done
> }
>
> function DeCompressLists()
> {
> # The lists may be kept compressed
> for FILES in $LISTOFLISTS
> do
> if test -f $FILES.gz ; then
> gunzip $FILES.gz
> fi
> done
> }
>
> function DeleteLists()
> {
> for FILES in $LISTOFLISTS
> do
> if test -f $FILES.gz ; then
> rm $FILES.gz
> fi
> done
> }
>
> function CreateDir ()
> {
> if ! test -d $1 ; then
> mkdir $1
> fi
> }
>
> function DeleteFile ()
> {
> if test -f $1 ; then
> rm $1
> fi
> }
>
>
> function make_rpmlist()
> {
> # I want to get a list of all files which came from an installation package,
> # so as not to backup them, as they are on the original CDs
> # (bck.rpmcheck.packlst). I also want to get a list of the same files, but
> # those which have been modified, because these I do want to backup them
> # (bck.rpmcheck.different). I got the idea from Yast1 (except it makes a tar).
> #
> # At the same time, I might as well save package list.
>
> echo “Making a list of all files in the rpm database which have been modified.”
> echo “Please be patient.”
>
> DeleteLists
>
> rpm --all --query --list | sort > $LISTOFALLFILESINRPMS & # List files included in a rpm pckg
> rpm --all --query | sort > $LISTOFALLRPMS & # list of all rpms (installed?)
> rpm --all --verify --nomd5
> | tee $LISTOFNOTVERIFIEDFILESINRPMS
> | sed -n ‘s/^S.* ///p;s/^…T.* ///p’
> | sort > $LISTOFMODIFIEDILESINRPMS &
> find $EXTRAPATHSTOBACKUP | sort > $LISTOFFOUNDFILES & # List all files in main directories
> wait
>
> # List files not belonging to an rpm, but existing in one of those directories
> comm -2 -3 $LISTOFFOUNDFILES $LISTOFALLFILESINRPMS > $LISTOFUNIQUEFILES # All files except those in a rpm
> }
>
>
> # functions make_copy() and make_CompressedCopy() are complementary: the 2nd needs the 1st.
> # On the other hand, make_CompressedCopyOnTheFly() doesn’t need make_copy() and thus uses less space.
> # If that saves time remains to be tested.
>
>
> function make_copy()
> {
> # Take the list of files created previously by make_rpmlist() in bck.rpmcheck.different,
> # and create a tree copy of it.
> # This will be used by mkzftree to create another tree, this time compressed
>
> echo “Making a copy of all the files we listed for backup, in $DESTINO_CPY”
>
> CreateDir $DESTINO_CPY
> DeCompressLists
> CheckFileExistsOrAbort $LISTOFMODIFIEDILESINRPMS
> CheckFileExistsOrAbort $LISTOFUNIQUEFILES
>
> while read FILES ; do
> if test -d “/$FILES” ; then
> $mkdir_ “$DESTINO_CPY/$FILES”
> let “COUNT_DIR = $COUNT_DIR + 1”
> else
> $cp_ --archive --no-dereference --preserve --parents “/$FILES” “$DESTINO_CPY”
> let “COUNT_FILE = $COUNT_FILE + 1”
> fi
> done < $LISTOFMODIFIEDILESINRPMS
>
> while read FILES ; do
> #if test -d “/$FILES” ; then
> #mkdir “$DESTINO_CPY/$FILES”
> #let “COUNT_DIR = $COUNT_DIR + 1”
> # echo skipping $FILES
> # No hace falta decir que saltamos los directorios; si tienen contenido se copiaran igual.
> # No need to say we skip directories; if they have contens they will be copied as well.
> #else
> if ! test -d “/$FILES” ; then
> $cp_ --archive --no-dereference --preserve --parents “/$FILES” “$DESTINO_CPY”
> let “COUNT_FILE = $COUNT_FILE + 1”
> fi
> done < $LISTOFUNIQUEFILES
>
> for FILES in $LISTOFLISTS
> do
> cp $FILES $DESTINO_CPY/basename $FILES
> done
>
> CompressLists
>
> echo “$COUNT_DIR directories created and $COUNT_FILE files copied”
> echo “The copy uses:”
> du --total --human-readable --summarize $DESTINO_CPY/*
> echo
> }
>
> function make_CompressedCopy()
> {
> echo “Making another copy, this time compressed, in $DESTINO_CMP”
> mkzftree --parallelism 3 $DESTINO_CPY $DESTINO_CMP
> echo “Compressed copy uses:”
> du --total --human-readable --summarize $DESTINO_CMP/*
> }
>
>
>
>
>
> function make_CompressedCopyOnTheFly
> {
> # We’ll make a compressed copy of the files we have listed (in $LISTOFMODIFIEDILESINRPMS),
> # one by one, using mkzftree, into $DESTINO_CMP.
> # Unfortunately, when copying single files mkzftree will not make dirs if the parent dirs were not previously created.
>
> echo “Making on the fly compressed tree in $DESTINO_CMP”
> CreateDir $DESTINO_CMP
> DeCompressLists
> DeleteFile $LISTOFALLPATHSTMP
>
> CheckFileExistsOrAbort $LISTOFMODIFIEDILESINRPMS
> CheckFileExistsOrAbort $LISTOFUNIQUEFILES
>
> # get a list of all paths we need to create
>
> # while read FILES ; do
> # if test -d “/$FILES” ; then
> # echo “/$FILES” >> $LISTOFALLPATHSTMP
> # else
> # $dirname_ “/$FILES” >> $LISTOFALLPATHSTMP
> # fi
> # done < $LISTOFMODIFIEDILESINRPMS
> #
> # while read FILES ; do
> # if test -d “$FILES” ; then
> # echo “$FILES” >> $LISTOFALLPATHSTMP
> # else
> # $dirname_ “$FILES” >> $LISTOFALLPATHSTMP
> # fi
> # done < $LISTOFUNIQUEFILES
> #
> # # now remove duplicates
> # cat $LISTOFALLPATHSTMP | sort | uniq > $LISTOFALLPATHS
> # rm $LISTOFALLPATHSTMP
> ## falla con los que tienen un espacio en el nombre, hay que pasarlo por sed. Tambien con los dos puntos
> #exit
>
> # and then make the directories.
> while read FILES ; do
> $mkdirhier_ $DESTINO_CMP/$FILES
> done < $LISTOFALLPATHS
>
> # From man mkdirhier (I got it in xf86-4.1.0-45):
> # The mkdirhier command creates the specified directories. Unlike mkdir if any of the parent directories of
> # the specified directory do not exist, it creates them as well.
>
>
> echo “Copy and compress modified files from rpms”
> while read FILES ; do
> if test -d “/$FILES” ; then
> $mkzftree_ --file --local “/$FILES” “$DESTINO_CMP/$FILES”
> let “COUNT_DIR = $COUNT_DIR + 1”
> #echo -n “-rd-”
> else
> $mkzftree_ --file “/$FILES” “$DESTINO_CMP/$FILES”
> let “COUNT_FILE = $COUNT_FILE + 1”
> #echo -n “-rf-”
> fi
> done < $LISTOFMODIFIEDILESINRPMS
>
> echo “Copy and compress certain files not in the rpms”
> while read FILES ; do
> if test -d “/$FILES” ; then
> if ! test -d “$DESTINO_CMP/$FILES” ; then
> $mkzftree_ --file --local “/$FILES” “$DESTINO_CMP/$FILES”
> let “COUNT_DIR = $COUNT_DIR + 1”
> #echo -n “-od-”
> fi
> else
> $mkzftree_ --file “/$FILES” “$DESTINO_CMP/$FILES”
> let “COUNT_FILE = $COUNT_FILE + 1”
> #echo -n “-of-”
> fi
> done < $LISTOFUNIQUEFILES
>
>
> echo “Copy and compress the lists of files used, for reference.”
> for FILES in $LISTOFLISTS
> do
> $mkzftree_ --file --local $FILES $DESTINO_CMP/basename $FILES
> #echo -n “-lf-”
> done
>
> CompressLists
>
> echo “$COUNT_DIR directories created and $COUNT_FILE files copied”
> echo “The compressed copy uses:”
> du --total --human-readable --summarize $DESTINO_CMP/*
> echo
> }
>
> function RemoveCopy()
> {
> rm --recursive $DESTINO_CPY/*
> rmdir $DESTINO_CPY
>
> }
>
>
> function CreateISO()
> {
> echo
> #echo Creando imagen ISO
> echo “Creating ISO image”
> mkisofs -z -R -quiet -graft-points
> -publisher “Not Published, private backup”
> -p “Carlos E. R.”
> -V “System Backup, Linux”
> -o $DESTINO_ISO $DESTINO_CMP
> #
> # download/=/home/cer/download/
> # compilaciones__tars/=/home/cer/compilaciones/_tars/
> # usr_src_packages_packages/=/usr/src/packages/
> # patches/=/var/lib/YaST/patches/i386/update/7.3/
> #echo “La imagen tiene este tamaño”
> echo “The image has this size”
> ls -l -h $DESTINO_ISO
> }
>
> function RemoveCompressedCopy()
> {
> rm --recursive $DESTINO_CMP/*
> rmdir $DESTINO_CMP
> }
>
>
>
> case “$1” in
> all)
> test_dest_compressed
> test_dest_iso
> make_rpmlist
> make_copy
> make_CompressedCopy
> RemoveCopy
> CreateISO
> RemoveCompressedCopy
> ;;
>
> rpm)
> make_rpmlist
> echo “Now do $BASENAME cpy or $BASENAME ccp”
> ;;
> cpy)
> make_copy
> echo “Now do $BASENAME cmp”
> ;;
> cmp)
> make_CompressedCopy
> echo “Now do $BASENAME rmcpy and $BASENAME iso”
> ;;
>
> ccp)
> make_CompressedCopyOnTheFly
> echo “Now do $BASENAME iso”
> ;;
>
> iso)
> CreateISO
> echo “Now do $BASENAME rmcmp; Then check and burn. You can mount iso image in /mnt with $BASENAME mnt”
> ;;
> rmcpy) RemoveCopy ;;
> rmcmp) RemoveCompressedCopy ;;
> rmiso) rm $DESTINO_ISO ;;
> mnt)
> mount -t iso9660 -o ro,loop=/dev/loop1 $DESTINO_ISO /mnt
> ;;
> umnt) umount /mnt ;;
> *)
> echo “Utility to do a system backup of files (not user files).”
> echo “Usage: $BASENAME {all|rpm|{[cpy|cmp]|ccp}|rmcpy|iso|rmcmp|mnt|umnt|rmiso}”
> ;;
> esac
>
>
>
> exit
>
> -abstract FILE
> Specifies the abstract file name.
> -biblio FILE
> Specifies the bibliographic file name.
> -copyright FILE
> Specifies the Copyright file name.
>
> -P Outdated option reserved by POSIX.1-2001, use -publisher
> instead. This option will get POSIX.1-2001 semantics with
> mkisofs-2.02.
>
> -publisher publisher_id
> Specifies a text string that will be written into the volume
> header. This should describe the publisher of the CDROM, usu#@
> ally with a mailing address and phone number. There is space on
> the disc for 128 characters of information. This parameter can
> also be set in the file .mkisofsrc with PUBL=. If specified in
> both places, the command line version is used.
>
> -p preparer_id
> Specifies a text string that will be written into the volume header. This should describe the pre
> parer of the CDROM, usually with a mailing address and phone number. There is space on the disc for
> 128 characters of information. This parameter can also be set in the file .mkisofsrc with PREP=. If
> specified in both places, the command line version is used.
>
> -sysid ID
> Specifies the system ID. This parameter can also be set in the file .mkisofsrc with SYSI=system_id.
> If specified in both places, the command line version is used.
>
> -V volid
> Specifies the volume ID (volume name or label) to be written into the master block. This parameter
> can also be set in the file .mkisofsrc with VOLI=id. If specified in both places, the command line
> version is used. Note that if you assign a volume ID, this is the name that will be used as the
> mount point used by the Solaris volume management system and the name that is assigned to the disc on
> a Microsoft Win32 or Apple Mac platform.
>
> -volset ID
> Specifies the volset ID. This parameter can also be set in the file .mkisofsrc with VOLS=volset_id.
> If specified in both places, the command line version is used.
>
>
> -allow-lowercase
> This options allows lower case characters to appear in iso9660 filenames.
> This violates the ISO9660 standard, but it happens to work on some systems. Use with caution.
>
> -D Do not use deep directory relocation, and instead just pack them in the way we see them.
> This violates the ISO9660 standard, but it happens to work on many systems. Use with caution.
>
> -dir-mode mode
> Overrides the mode of directories used to create the image to mode. Specifying this option automati
> cally enables Rock Ridge extensions.
>
> -file-mode mode
> Overrides the mode of regular files used to create the image to mode. Specifying this option auto
> matically enables Rock Ridge extensions.
>
> -gid gid
> Overrides the gid read from the source files to the value of gid. Specifying this option
> automatically enables Rock Ridge extensions.
>
> -graft-points
> Allow to use graft points for filenames. If this option is used, all filenames are checked for graft
> points. The filename is divided at the first unescaped equal sign. All occurrences of ‘\’ and ‘=’
> characters must be escaped with ‘\’ if -graft-points has been specified.
>
> -l Allow full 31 character filenames. Normally the ISO9660 filename will be in an 8.3 format which is
> compatible with MS-DOS, even though the ISO9660 standard allows filenames of up to 31 characters. If
> you use this option, the disc may be difficult to use on a MS-DOS system, but this comes in handy on
> some other systems (such as the Amiga). Use with caution.
>
> -iso-level level
> Set the iso9660 conformance level. Valid numbers are 1…3.
>
> With level 1, files may only consist of one section and filenames are restricted to 8.3 characters.
>
> With level 2, files may only consist of one section.
>
> With level 3, no restrictions apply.
>
> With all iso9660 levels all filenames are restricted to upper case letters, numbers and the under
> score (). The maximum filename length is restricted to 31 characters, the directory nesting level is
> restricted to 8 and the maximum path length is limited to 255 characters.
>
> -log-file log_file
> Redirect all error, warning and informational messages to log_file instead of the standard error.
>
> -max-iso9660-filenames
> Allow 37 chars in iso9660 filenames. This option forces the -N option as the extra name space is
> taken from the space reserved for ISO-9660 version numbers.
> This violates the ISO9660 standard, but it happens to work on many systems. Although a conforming
> application needs to provide a buffer space of at least 37 characters, disks created with this option
> may cause a buffer overflow in the reading operating system. Use with extreme care.
>
> -new-dir-mode mode
> Mode to use when creating new directories in the iso fs image. The default mode is 0555.
>
> -nobak
> -no-bak
> Do not include backup files files on the iso9660 filesystem. If the -no-bak option is specified,
> files that contain the characters ‘~’ or ‘#’ or end in ‘.bak’ will not be included (these are typi
> cally backup files for editors under unix).
>
> -o filename
> is the name of the file to which the iso9660 filesystem image should be written. This can be a disk
> file, a tape drive, or it can correspond directly to the device name of the optical disc writer. If
> not specified, stdout is used. Note that the output can also be a block special device for a regular
> disk drive, in which case the disk partition can be mounted and examined to ensure that the premas
> tering was done correctly.
>
> -path-list file
> A file containing a list of pathspec directories and filenames to be added to the ISO9660 filesystem.
> This list of pathspecs are processed after any that appear on the command line. If the argument is -,
> then the list is read from the standard input. There must be at least one pathspec given on the com
> mand line as well.
>
>
> -R Generate SUSP and RR records using the Rock Ridge protocol to further describe the files on the
> iso9660 filesystem.
>
> -r This is like the -R option, but file ownership and modes are set to more useful values. The uid and
> gid are set to zero, because they are usually only useful on the author’s system, and not useful to
> the client. All the file read bits are set true, so that files and directories are globally readable
> on the client. If any execute bit is set for a file, set all of the execute bits, so that executa
> bles are globally executable on the client. If any search bit is set for a directory, set all of the
> search bits, so that directories are globally searchable on the client. All write bits are cleared,
> because the CD-Rom will be mounted read-only in any case. If any of the special mode bits are set,
> clear them, because file locks are not useful on a read-only file system, and set-id bits are not
> desirable for uid 0 or gid 0. When used on Win32, the execute bit is set on all files. This is a
> result of the lack of file permissions on Win32 and the Cygwin POSIX emulation layer. See also -uid
> -gid, -dir-mode, -file-mode and -new-dir-mode.
>
> -relaxed-filenames
> The option -relaxed-filenames allows ISO9660 filenames to include digits, uppercase characters and
> all other 7 bit ASCII characters (resp. anything except lowercase characters).
> This violates the ISO9660 standard, but it happens to work on many systems. Use with caution.
>
>
> -v Verbose execution. If given twice on the command line, extra debug information will be printed.
>
> -x path
> Exclude path from being written to CDROM. path must be the complete pathname that results from con
> catenating the pathname given as command line argument and the path relative to this directory. Mul
> tiple paths may be excluded. Example:
>
> mkisofs -o cd -x /local/dir1 -x /local/dir2 /local
>
> NOTE: The -m and -x option description should both be updated, they are wrong. Both now work identi
> cal and use filename globbing. A file is excluded if either the last component matches or the whole
> path matches.
>
> -z Generate special RRIP records for transparently compressed files. This is only of use and interest
> for hosts that support transparent decompression, such as Linux 2.4.14 or later. You must specify
> the -R or -r options to enable RockRidge, and generate compressed files using the mkzftree utility
> before running mkisofs.
>
>
>
> mkisofs -abstract FILE ] -allow-lowercase ] -allow-multidot ] -biblio FILE ] -cache-inodes ]
> -no-cache-inodes ] -b eltorito_boot_image ] -eltorito-alt-boot ] -B sparc_boot_image_list ] -G
> generic_boot_image ] -gui ] -C #,# ] -hard-disk-boot ] -no-emul-boot ] -no-boot ] -boot-load-seg
> ] -boot-load-size ] -boot-info-table ] -c boot_catalog ] -check-oldnames ] -check-session FILE ]
> -copyright FILE ] -A application_id ] -f ] -d ] -D ] -dir-mode mode ] -file-mode mode ] -gid
> gid ] -hide glob ] -hide-list file ] -hidden glob ] -hidden-list file ] -hide-joliet glob ]
> -hide-joliet-list file ] -hide-joliet-trans-tbl ] -hide-rr-moved ] -iso-level level ] -input-charset
> charset ] -output-charset charset ] -J ] -jcharset charset ] -l ] -L ] -log-file log_file ]
> -max-iso9660-filenames ] -M path | device ] -new-dir-mode mode ] -nobak ] -no-bak ] -no-split-sym
> link-components ] -no-split-symlink-fields ] -pad ] -no-pad ] -path-list file ] -p preparer ]
> -print-size ] -P publisher ] -quiet ] -r ] -R ] -relaxed-filenames ] -sort sort file ] -sysid
> ID ] -T | -table-name TABLE_NAME ] -ucs-level level ] -uid uid ] -use-fileversion ] -U ] -no-
> iso-translate ] -v ] -V volid ] -volset ID ] -volset-size # ] -volset-seqno # ] -x path ]
> -exclude-list file ] -z ] -m glob ] -hfs | -apple ] -map mapping_file ] -magic magic_file ]
> -probe ] -no-desktop ] -mac-name ] -boot-hfs-file driver_file -part ] -auto AutoStart_file ]
> -cluster-size size ] -hide-hfs glob ] -hide-hfs-list file ] -hfs-volid hfs_volid ] -icon-position ]
> -root-info FILE -prep-boot FILE ] -hfs-creator CREATOR ] -hfs-type TYPE ] -input-hfs-charset
> charset ] -output-hfs-charset charset ] -hfs-unlock ] -hfs-bless folder_name ] --cap ] --netatalk
> ] --double ] --ethershare ] --ushare ] --exchange ] --sgi ] --xinet ] --macbin ] --single ]
> --dave ] --sfm ] -o filename pathspec [pathspec]
>
>
>
> exit
>
> -R Generate SUSP and RR records using the Rock Ridge
> protocol to further describe the files on the
> iso9660 filesystem.
>
> -r This is like the -R option, but file ownership and
> modes are set to more useful values. The uid and
> gid are set to zero, because they are usually only
> useful on the author’s system, and not useful to
> the client. All the file read bits are set true,
>
> -z Generate special RRIP records for transparently
> compressed files. This is only of use and interest
> for hosts that support transparent decompression,
> such as Linux 2.4.14 or later. You must specify
> the -R or -r options to enable RockRidge, and gen
> erate compressed files using the mkzftree utility
> before running mkisofs.
>
>
>
>
>
> # Coments - rpm part
>
> # Yast did this, but I believe rpm sintaxis has changed a little:
> # rpm --dbpath /var/lib/rpm -V ldp --nodeps --noscripts --nomd5
> # ^^^ el paquete. creo que es mejor simplemente --all
> # sed -n ‘s/^S.* ///p;s/^…T.* ///p’ >/tmp/YaST.tdir/stp287_525_S 2>/tmp/YaST.tdir/stp287_525_E
> #
>
>
> # The general form of an rpm verify command is
> #
> # rpm -V|-y|–verify [verify-options]
> #
> # Verifying a package compares information about the installed files in the package with information about the
> # files taken from the original package and stored in the rpm database. Among other things, verifying com
> # pares the size, MD5 sum, permissions, type, owner and group of each file. Any discrepencies are displayed.
> # The package specification options are the same as for package querying.
> #
> # Files that were not installed from the package, for example documentation files excluded on installation
> # using the “–excludedocs” option, will be silently ignored.
> #
> # Options that can be used in verify mode:
> #
> # --nofiles
> # Ignores missing files when verifying. No funciona.
> #
> # --nomd5
> # Ignores MD5 checksum errors when verifying.
> #
> # --nopgp
> # Ignores PGP checking errors when verifying.
> #
> # --nofiles
> # Ignores missing files when verifying.
> #
> # The format of the output is a string of 8 characters, a possible “c” denoting a configuration file,
> # and then the file name. Each of the 8 characters denotes the result of a comparison of one attribute
> # of the file to the value of that attribute recorded in the RPM database. A single “.” (period) means
> # the test passed. The following characters denote failure of certain tests:
> #
> # 5 MD5 sum
> #
> # S File size
> #
> # L Symlink
> #
> # T Mtime
> #
> # D Device
> #
> # U User
> #
> # G Group
> #
> # M Mode (includes permissions and file type)
> #
>
>
All that is old code I haven’t used in years, so take with a pinch of salt.
Don’t ask me many things, I don’t remember myself ;-p )
But I hope it gives you ideas.
–
Cheers / Saludos,
Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)
#1 If I may suggest, why not use PartImage to backup /home ? Partimage-manual Usage - Partimage It uses compression and multiple smaller image files for offloading to DVD or CD depending on image.
#2 It didn’t look like the script saved anything from /home but did a reinstall of packages found in zypper’s cache.
I’m not sure how reliable that the zypper cache would be as far as installed packages.
I think :
rpm -qa > installed.txt
zypper se ‘*’ -i > installed.txt
would give you listings of all installed packages known to rpm and zypper.
this looks pretty good. will trie this out although i like the way rsync does it.
nope actually it does not backing up home. it gets all packages currently installed and drops them in the cache rpms. so all you have todo to restore the system to the previous state is to reinstall those packages again. this should be done by the script also ./packagesate -r rpms.tar.gz. the problem i have with this that the scripts stops when the connection is lost and loads everything again. the -d option is the download only option which only download the packages but does not install them.
you are right. and yes zypper is a frontend i know that too. however this outut can not be parsed by zypper afterwards. i played around a little with this to figure out the best way of how getting this done. and as far as i am concerned this is the best way i found.
Really seemed to work when I tested, though I didn’t want to update my system.
sudo zypper refresh && for a in `cat t.txt` ; do echo "installing" $a ; sudo zypper in --dry-run -n $a ; sleep 5; done
FWIW, it looks like you’re backing up what rpm packages are installed in your system and a said restore. I don’t know why you’d want to do that when those packages are available online for you to download and reinstall.
The important stuff you should back up are your data files and configuration files, which are not available online. Like /home/user/ and folders containing your movies, pictures, music, MySQL/ProgressSQl database, HTTP/Apache, VirtualBox/Xen servers, mail servers, etc. I’d start with PartImage /home/userid, a tar gzip of /etc , PartImage /var and /srv if you’re running servers. PartImage should pickup the hidden files and folders, like .alias, .mozilla, .thunderbird, .evolution and all your configuration files. as would a tar gzip of /etc. I think PartImage allows incremental backups.
Then if your system crashes you could restore system from your backups and downloads from SUSE.
Bear in mind that even though you can make a backup of everything in cache or of all packages installed chances are a package might have been updated between your backups.
nope my experience are different once. sometimes packages get changes and the older packages are not available any longer. that becomes even more problematic if updating a package has revealed a bug and because the older one is no longer available you are stuck and going back is not possible.
and for another you are assuming that one is always online which is not the case.
but lets not talk about this script any longer i did figure out how to solve my problem anyway and will post an other commit by today