Home
Name Modified Size InfoDownloads / Week
cpos-1.2.64-1.mga7.noarch.rpm 2018-04-10 28.9 kB
cpos-1.2.64-1.mga7.src.rpm 2018-04-10 29.2 kB
cpos-1.2.64.tar.bz2 2018-04-10 22.0 kB
README 2016-12-13 5.4 kB
Totals: 4 Items   85.6 kB 0
The "cpos" bash script within enables the user to either back up the current system partition to an alternate partiton, or copy it to a timestamped tar file for archive purposes.
The mode used to backup to an alternate partition will allow that other partition to be used as an identical partition that can be booted up, and which will be identical to the current system partition, except for a modified /etc/fstab file, a modified /boot/grub/menu.lst file, and a modified /etc/cpos.conf file that will operate properly when the alternate partition is used for bootup.
The mode used to create a timestamped tar file will create a backup tar file that can later be used to properly restore the current system partition. This tar file contains an empty /etc/fstab file, as well as a copy of the original /etc/fstab file. This allows the current system partition to be restored in such a way that it will not corrupt any mounted filesystems after restoration.
There is one more hidden mode that acts exactly like the backup to an alternate partition, except that it uses rsync for the backup which is much faster.
More specific directions are included within.

There is also a helper script called "put-kernel" that copies a defined kernel to a given directory along with it's modules. This allows the user to create a tar file of a given kernel that can be easily copied to another system.

A MORE DETAILED EXPLANATION
===========================

The "cpos" script makes a bootable backup copy of the current "/" partition defined by the
ROOT_MOUNT_POINT variable defined in the /etc/cpos.conf file, or a tar file copy of the "/" partition, to a partition defined in the BACKUP_MOUNT_POINTS variable ( a comma delimited list of possible partitons to copy to ).

For the purpose of this README, I use partition to mean the mount point for that partition
as defined in /etc/fstab.

Before the backup copy operation happens, the backup partition is
formatted, so be careful to define the partitions properly in /etc/fstab,
and /etc/cpos.conf, before doing anything else, and to read the documentation carefully.

The purpose of this is to make a bootable identical copy of the current "/" directory
( let's call it "linux1" ) to a second partition ( let's call it "linux2" ),
and all changes will be made to that partition to make it bootable. Therefore, an
entry for this partition should be put into the lilo, grub, or grub2 (depending upon which
you currently use as a boot manager ) that will cause that partition to
properly boot. The "cpos" script modifies the /boot/grub/menu.lst file, so
"cpos" assumes a grub bootmanager configuration, but grub2-menulst2cfg can
later be used to convert that menu.lst file to a grub2 format if you would
rather use grub2.

The BACKUP_MOUNT_POINTS variable can contain more than one backup partitions, in which case
a dialog box is generated with a choice of the partition for the backup.

The script copies the current "/" partition only. All mounted partitions
are umounted and are not copied; and all directories defined by the STUBBED_DIRS variable are copied
without any files within them. The "cpos" script will attempt to stop all
services that would keep partitions from being unmounted, then restart them
after the copy is done. After the copy is made, and all services restarted, the
script creates an initrd image file on the copied partition, "linux2", then modifies the /etc/fstab
file, makes some changes to the /etc/cpos.conf file on the copied partition, and reruns the
boot manager to make the copied partition properly bootable ( depending upon the setting
of the RUN_BOOTLOADER_AFTER_COMPLETION variable ).

A DAEMON_DEPENDENCIES variable is defined that should contain the name of the
services that must be stopped to unmount all partitions except the "/", and the
"/tmp" directory.These services will be restarted after completion of the script,
with the exception of those services defined that weren't running.

A STOP_PROGRAM_LIST array is defined that should contain the name of any
executable programs that aren't set up as a service (skype and clementine are
examples), that must be stopped to backup the system properly. the syntax is defined in the config
file by example.

A log file defined by the LASTBACKUP_LOG variable tracks the success or failure of
the copy operation.

If the -d option is chosen, all services defined in the DAEMON_DEPENDENCIES variable are stopped,
but no format, or copy is performed.

If the -e option is chosen, all services that were stopped after using the -s option are restarted,
but no format, or copy is performed.

If the -r option is chosen, cpos uses rsync, and doesn't format the partition
that is to act as the ROOT_MOUNT_POINT.

If the -b option is chosen, the backup partition is formatted, and a tar file of the "/" partition is
created. This is to allow a backup tar file to be generated that can be saved.

If the -n option is chosen, the backup partition formatting will be bypassed, but the copy will be
performed to that partition.

The mode to copy to an alternate partition is defined by using "cpos" to
format the alternate partition first; or "cpos -r" to skip formatting the
alternate partition, and use rsync for the copy.

The mode create a timestamped tar file is defined by using "cpos -nb" to avoid
formatting the partition to receive the tar file, and to create the tar file.

Source: README, updated 2016-12-13