Menu

#146 Autobackup with clonezilla (grub entry) in a folder which contains actual date

closed-duplicate
None
5
2021-01-13
2021-01-04
zomgomg
No

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?

Discussion

  • Steven Shiau

    Steven Shiau - 2021-01-04
    • status: open --> closed-duplicate
    • assigned_to: Steven Shiau
     
  • Steven Shiau

    Steven Shiau - 2021-01-04

    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

     
    • zomgomg

      zomgomg - 2021-01-05

      I already this with the testing live version like this

      menuentry "Clonezilla Live 2.7.1-8 (Unattended Backup)" {
      set isofile="/isos/clonezilla-live-2.7.1-8-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 autoname-backup-year-date-time\" ocs_live_extra_param=\"\" keybo>
      initrd (loop)/live/initrd.img
      }
      

      or like this

      menuentry "Clonezilla Live 2.7.1-8 (Unattended Backup)" {
      set isofile="/isos/clonezilla-live-2.7.1-8-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 autoname-backup-year-date-time sda\" ocs_live_extra_param=\"\" keybo>
      initrd (loop)/live/initrd.img
      }
      

      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
  • Steven Shiau

    Steven Shiau - 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
  • zomgomg

    zomgomg - 2021-01-06

    Yes, i forget to copypaste the whole line:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    #!/bin/sh
    exec tail -n +3 $0
    # This file provides an easy way to add custom menu entries.  Simply type the
    # menu entries you want to add after this comment.  Be careful not to change
    # the 'exec tail' line above.
    menuentry "Clonezilla Live 2.7.0-10" {
    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_live_run=\"ocs-live-general\" ocs_live_extra_param=\"\" keyboard-layouts=\"\" ocs_live_batch=\"no\" locales=\"\" vga=788 ip=frommedia nosplash toram=filesystem.squashfs findiso=$isofile
    initrd (loop)/live/initrd.img
    }
    
    menuentry "Clonezilla Live 2.7.1-8 (Unattended Backup)" {
    set isofile="/isos/clonezilla-live-2.7.1-8-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 autoname-backup-year-date-time\" ocs_live_extra_param=\"\" keyboard-layouts=\"\" ocs_live_batch=\"yes\" locales=\"\" vga=788 ip=frommedia nosplash toram=filesystem.squashfs findiso=$isofile
    initrd (loop)/live/initrd.img
    }
    

    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" ?

     
  • Steven Shiau

    Steven Shiau - 2021-01-07

    "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

     
  • zomgomg

    zomgomg - 2021-01-07

    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:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    #!/bin/sh
    exec tail -n +3 $0
    # This file provides an easy way to add custom menu entries.  Simply type the
    # menu entries you want to add after this comment.  Be careful not to change
    # the 'exec tail' line above.
    menuentry "Clonezilla Live 2.7.0-10" {
    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_live_run=\"ocs-live-general\" ocs_live_extra_param=\"\" keyboard-layouts=\"\" ocs_live_batch=\"no\" locales=\"\" vga=788 ip=frommedia nosplash toram=filesystem.squashfs findiso=$isofile
    initrd (loop)/live/initrd.img
    }
    
    menuentry "Clonezilla Live 2.7.1-8 (Unattended Backup)" {
    set isofile="/isos/clonezilla-live-2.7.1-8-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 autoname-backup-year-date-time sda\" ocs_live_extra_param=\"\" keyboard-layouts=\"\" ocs_live_batch=\"yes\" locales=\"\" vga=788 ip=frommedia nosplash toram=filesystem.squashfs findiso=$isofile
    initrd (loop)/live/initrd.img
    }
    

    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

    1
    2
    3
    4
    5
    #!/bin/sh
    # Set grub to boot to the unattended backup
    /usr/sbin/grub-reboot "Clonezilla Live 2.3.1-18 (Unattended Backup)"
    # Reboot server
    /sbin/reboot
    

    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 like backup-2021-01-07 or backup-07-01-2021?

     

    Last edit: zomgomg 2021-01-07
  • Steven Shiau

    Steven Shiau - 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

     
    • zomgomg

      zomgomg - 2021-01-08

      Cool, can't wait!

       
  • Steven Shiau

    Steven Shiau - 2021-01-13

    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

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.