Clone system backup is the perfect way to store and restore your operating system without to loose data and applications that it took you so long time and effort to achieve. Additionally very fast you can restore your operating system and bring back exactly how it was .You can store your operating system on another partition, hard drive or preferably to external medium. The best way is to store in an img.gz format to avoid luck of space and size.
For example my operating system installed on almost 30 gigabyte size partition with 9GB space occupied, it can be stored as an image.gz format to a file taking 6.8 gigabyte size in about 28 minutes.
To restore it takes about 18 minutes in my laptop with dual core processor. Time is always according the pc and the store medium speed abilities.
The ideal way to clone system backup is to be automatic, perfect way if you do not have time or forget this important work of your operating system. The backup will be automatically with the application gnome-schedule, using the commands dd and gzip.
The gnome-schedule is a great tool with many programming options. In this guide you will see the more advanced root operation.
In this tutorial home and root are together because configuration files are on home folder and are very important for the reliable function of the applications and root is your operating system. For me a compact system is the best.
Pay attention Cloning system backup will take place within your operating system for that reason not to run applications that disturb the operation. Browsing and listening music from my experience will not causing issues, but the best is not even to have network activities.
Step 1
First to check from Terminal if the cron job operates and it is active.
Code: Select all
service cron status
If not then you start the application.[ ok ] cron is running.
Code: Select all
sudo service cron start
Code: Select all
sudo passwd root
Install the gnome-schedule.
Code: Select all
sudo apt-get install gnome-schedule
Code: Select all
sudo gnome-schedule
Once you start the gnome-schedule, go on the left will select New> A task that launches recurrently or Recurrent task.
Step 4
Here you will customize the program.
Description: Give a name to work (I gave MX-15xfce).
Default behaviour: Leave as it is.
Command: The most important part pay attention.
The following command you will customize according to your settings, and it would be good to save and modify in LibreOffice Culc.
Code: Select all
sudo service network-manager stop && DISPLAY=:0.0 sudo -u panpan /usr/bin/notify-send "Start Cloning system" && dd if=/dev/sda9 bs=4096 conv=notrunc,noerror | gzip> /media/LAPTOPSTORE/Lenovo5030/MX15xfce.img.gz && DISPLAY=:0.0 sudo -u panpan /usr/bin/notify-send "Completed Cloning System" && sudo service network-manager restart
Pay attention to the bold letters not to have any space between them otherwise the command will not work.
As you notice the code has sudo service network-manager stop and sudo service network-manager restart. If you want to have a good backup you must not interact with you system direct or indirect, which means not any activity by you or the Internet.
If those commands do not work for you can skip them.
Nextsudo service network-manager stop &&
&& sudo service network-manager restart
1) Change to your own user name panpan is mine.
2) Instead sda9 which is my own partition of my operating system, the corresponding yours. You can find yours by sudo blkid or by opening gparted.
3) Made the destination backup folder on a different sector (partition) of the hard drive or an external storage. After making that folder right click that folder copy and paste to replace part of my own example [/ media /LAPTOPSTORE/Lenovo5030], with the corresponding yours.
After you add the name of the image that you want to give [xxxxxxx.img.gz]. So your command will look like this.
Code: Select all
sudo service network-manager stop && DISPLAY=:0.0 sudo -u username /usr/bin/notify-send "Start Cloning system" && dd if=/dev/sda9 bs=4096 conv=notrunc,noerror | gzip> /media/xxxxxx/xxxxxxx/xxxxxxx.img.gz && DISPLAY =:0.0 sudo -u username /usr/bin/notify-send "Completed Cloning System" && sudo service network-manager restart
Step 5
The following settings you can modify to suit your needs, I show what settings I have chosen.
Select the Field Advanced >
1) Month > Edit > Every month > OK. Every month to run the task.
2) Day > Edit > In a step width - Days 7 > OK. To perform the task every 7 days of the month. A good setting for something that went wrong recently.
3) Hour > Edit > At an exact hour- Hour 11 > OK. To run on 11 or your own time selection.
4) Minute 0
Pay attention do not select the Edit option (in a range, it will do the job every, minute, hour and so on.
When you complete the settings you select Add > OK and ready your backup order for automatic image storage.
Step 6
Now some things to keep in mind. The backup will be automatically and if you don't change the name MX15xfce.img.gz, then it remains the same file and every time that does the backup, it will be replaced again and again. Only you will know that it is the latest version of image backup. If you have space at your store and want to save more images, then you change the file name at the backup storage from MX15xfce.img.gz, to MX15xfce1.img.gz after the first storage. The same way you can store more images.
To see when the cloning backup starts and stops follow this post.
viewtopic.php?f=108&t=39554&hilit=recen ... 20#p381375
Step 7If you want to do the cloning backup manual:
From the program you can select the task > Then above - run selected task - > Execute
or
modify the command according your settings:
dd if=/dev/sda9 bs=4096 conv=notrunc,noerror | gzip> /media/LAPTOPSTORE/Lenovo5030/MX15xfce.img.gz
then
sudo su
and run the command at the terminal
Restore your cloning saved backup to your system
Always restore takes place outside the operating system from Live DVD, USB or other functional Linux operating system.
From the Terminal first the command.
Code: Select all
sudo su
Code: Select all
gzip -dc /media/LAPTOPSTORE/Lenovo5030/MX15xfce.img.gz | dd of =/dev/sdax bs=4096 conv=notrunc,noerror
If you have correctly made the restore command, in LibreOffice Culc, next time you use the same by copying and pasting.
During the operation open another terminal give the following command to see the procedure of the work from the first terminal.
Code: Select all
watch -n5 'sudo kill -USR1 $ (pgrep ^ dd)'
Enjoy this important automatic operation.