Autobackup with clonezilla (grub entry) in a folder which contains actual date
A partition and disk imaging/cloning program
Brought to you by:
steven_shiau
I followed this tutorial for auto backuping my system with clonezilla - its an extra entry in my grub.
So short, this is my /etc/grub.d/40_custom
:
menuentry "Clonezilla Live 2.7.0-10 (Unattended Backup)" { set isofile="/isos/clonezilla-live-2.7.0-10-i686.iso" loopback loop (hd1,gpt2)$isofile linux (loop)/live/vmlinuz boot=live live-config union=overlay noswap nolocales edd=on nomodeset ocs_prerun=\"mount /dev/sdb1 /mnt\" ocs_prerun1=\"mount --bind /mnt/backup /home/partimag/\" ocs_live_run=\"ocs-sr -q2 --batch -j2 -z1p -i 2000 -sc -p reboot savedisk autoproductname sda\" ocs_live_extra_param=\"\" keybo> initrd (loop)/live/initrd.img }
And its working. But its only create a folder called /mnt/backup/___-img
. autoproductname
don't create a name related to my computer. But thats not the problem. I need a folder which contains the actual date. But replacing autoproductname
with $(date)
runs into an issue with update-grub
:
Generating grub configuration file ... Found theme: /usr/share/grub/themes/manjaro/theme.txt Found linux image: /boot/vmlinuz-5.9-x86_64 Found initrd image: /boot/intel-ucode.img /boot/initramfs-5.9-x86_64.img Found initrd fallback image: /boot/initramfs-5.9-x86_64-fallback.img Adding boot menu entry for UEFI Firmware Settings ... Found memtest86+ image: /boot/memtest86+/memtest.bin Fehler: $. Fehler: syntax error. Fehler: Incorrect command. Fehler: syntax error. Syntaxfehler in Zeile 203 Syntax errors are detected in generated GRUB config file. Ensure that there are no errors in /etc/default/grub and /etc/grub.d/* files or please file a bug report with /boot/grub/grub.cfg.new file attached.
So how is it possible to autobackup my system in a folder which is like 2021-01-03
?
You can refer to this:
https://sourceforge.net/p/clonezilla/support-requests/144/
A new feature has been added in the testing Clonezilla live recently. It should meet your need.
Steven
I already this with the testing live version like this
or like this
but this don't work. How exactly should the grub entry looks like with autoname-backup-year-date-time-uuid?
Last edit: zomgomg 2021-01-05
The 1st one:
linux (loop)/live/vmlinuz boot=live live-config union=overlay noswap nolocales edd=on nomodeset ocs_prerun=\"mount /dev/sdb1 /mnt\" ocs_prerun1=\"mount --bind /mnt/backup /home/partimag/\" ocs_live_run=\"ocs-sr -q2 --batch -j2 -z1p -i 2000 -sc -p reboot savedisk autoname-backup-year-date-time\" ocs_live_extra_param=\"\" keybo>
You missed the source device. ocs_live_run should be like:
ocs_live_run="ocs-sr -q2 --batch -j2 -z1p -i 2000 -sc -p reboot savedisk autoname-backup-year-date-time sda"
It seems you did not post the complete line about "linux...".
BTW, please tell us what did you mean by "this does not work". You should say more about the results... Take photos about the output on the screen, etc... Otherwise we have no idea where went wrong there.
Steven
Last edit: Steven Shiau 2021-01-07
Yes, i forget to copypaste the whole line:
The backup works. But the name is still wrong.

e.g. the folders name is
___-img
.Also you said, that i missed the source device and that the ocs_live_run should looks different. But your line
ocs_live_run="ocs-sr -q2 --batch -j2 -z1p -i 2000 -sc -p reboot savedisk autoname-backup-year-date-time"
is the same as above.
My source device is /dev/sda
So you mean
ocs_live_run="ocs-sr -q2 --batch -j2 -z1p -i 2000 -sc -p reboot savedisk autoname-backup-year-date-time sda"
?"ocs_live_run="ocs-sr -q2 --batch -j2 -z1p -i 2000 -sc -p reboot savedisk autoname-backup-year-date-time sda"-> Yes. Somehow I also did it wrong as you did. :)
The previous post was modified.
However, I am still not able to reproduce your issue. It just works here, and others also confirmed it can be used successfully.
Or you share the customized Clonezilla live iso you have created? I will try to run it here.
Steven
It's not a customized iso. I downloaded it from here: https://clonezilla.org/downloads/download.php?branch=testing (there is already version 2.7.1-10). I use 2.7.1-8-i686.
My grub entry:
But i also tested it with clonezilla-live-2.7.1-10-i686.iso. Still the same, the directory i s called
___-img
.Buuuuuuuuut i found the problem! I call the backup with script like
But i never changed line 3. Now it works and my backup-folder is called
backup-2021-0107-1508
.Any chance to change the format? Now i use
autoname-backup-year-date
so i'll get
backup-2021-0107
. Something likebackup-2021-01-07
orbackup-07-01-2021
?Last edit: zomgomg 2021-01-07
Ha, sure. Thanks for sharing that.
Sure. We can add "month", "day", "hour", "minute" for this purpose in the next release.
Steven
Cool, can't wait!
Please give Clonezilla live >= 2.7.1-15 or 20210112-* a try.
Remember to check the change log:
https://clonezilla.org/downloads/testing/changelog.php
Please let us know the results. Thanks.
Steven