Timeshift configuration

  • Hi there,


    I just set up timeshift in my two openmediavault machines. I just wanted to describe my process (almost a mini-guide) in case somebody finds it useful. Any comments are welcome!!


    Timeshift is a well known software to run a back-up of a running system, with the ability to create snapshots.

    On normal desktop machines the program has a very nice and functional GUI for both set-up and restore process.

    For an headless system the configuration needs to be performed via CLI, but this is really easy. Similarly, it is possible to revert to a previous snapshot via CLI or using a live distro (e.g. Systemrescue) in case the main system is no longer functional.


    1) First thing we need to install timeshift. From terminal run

    Code
    sudo apt-get install timeshift

    next we need to write the configuration file


    Code
    sudo nano /etc/timeshift/timeshift.json

    copy and edit the following text in the configuration file:



    the content of the file is self explanatory and it closely mimics the GUI parameters that are filled in during the set-up process on a desktop machine.


    pay attention to the following

    • enter the UUID of the disk that will save the backup files (not the main disk). Saving the files in a disk that is not the main system is highly recommended
    • in the exclude section add the home directory for each user in the system
    • the include/exclude syntax requires you to add first the directories to include and then the directories to exclude, in this order, see my example with the /srv directory . The other way round fails on my system
    • look up the difference between *, ** and ***


    Once all this is taken care of, run the following command to make the first snapshot


    Code
    sudo timeshift --check

    the command will create the first snapshot and it will create a new cron job /etc/cron.d/timeshift-hourly


    every hour the system will run the check command and create snapshots based on the json file


    that's it!


    to restore the system to a previous snapshot run


    Code
    sudo timeshift --restore

    and the system will interactively guide you during the task. Alternatively fire up Systemrescue, timeshift is included in the base packages.


    as usual:

    Code
    sudo timeshift man

    is your best friend.


    Enjoy!


    FT

  • Might be a good idea to move this to the Guides section.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

    • Official Post

    I don't think I have the permissions for this. Probably it's a task for a moderator...

    You can create a guide in the guides section yourself, copy the content and leave this thread open so people can ask questions. Only the creator of the guide can write in the guides section threads.

  • Might be a good idea to move this to the Guides section.

    Could "timeshift" be incorporated in OMV going forward?. It does exist as standard in many Linux Debian and Ubuntu distros, so why "timeshift" is not part of OMV?. Works in CLI when installed.

    Linux Mint (Edge) EndeavourOS Arch Linux

    OMV7 NAS, bond0 LACP, Fractal Design Define R5 Case, Kodi "Omega", FreeBSD pfSense Plus firewall/router

  • .. I wish I was able to write a plugin!

    The existing plugin to backup the system could be further extended to include Timeshift


    However I'm also aware that there's only so much the developers and maintainers can do, and I'm grateful that we have such a solid system.

  • .. I wish I was able to write a plugin!

    The existing plugin to backup the system could be further extended to include Timeshift


    However I'm also aware that there's only so much the developers and maintainers can do, and I'm grateful that we have such a solid system.

    @"ftriscari" You are preaching to the same quire. I just find myself dumbfounded that solution to OMV backup was always there --> timeshift. I use it every day on my Linux boxes, but it never down on me to use timeshift on OMV, This is so obvious and such a simple solution. Thank you for reminding us that "KISS is always the best way. I also would not attempt to write a plugin for OMV, I am just NOT qualified for that, but it would be great if someone, in their spare time, write GUI plugin.

    Linux Mint (Edge) EndeavourOS Arch Linux

    OMV7 NAS, bond0 LACP, Fractal Design Define R5 Case, Kodi "Omega", FreeBSD pfSense Plus firewall/router

    Edited once, last by andrzejls: proper wowding. ().

    • Official Post

    I will look at it again.

    omv 7.4.2-2 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.14 | compose 7.2.1 | k8s 7.2.0-1 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.0.8


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • What about the comment on the GitHub page of the timeshift project:

    I think the developers of the project have mentioned that with reason.

    "It is designed to protect only system files and settings. User files such as documents, pictures and music are excluded." That statement is NOT correct. At least in Ubuntu, it is backing up and restoring ALL files including pictures, music etc. I have set up timeshift to back up all "root" and "user" files and it does just that.

    Linux Mint (Edge) EndeavourOS Arch Linux

    OMV7 NAS, bond0 LACP, Fractal Design Define R5 Case, Kodi "Omega", FreeBSD pfSense Plus firewall/router

  • Just one word of caution on your setup...


    You can use Timeshift for user data backup however this is discouraged for good reasons.


    In actual fact Timeshift is not a backup solution.


    Timeshift takes a snapshot and then, by design, it brings the system back to that snapshot. This means that it you take a snapshot of your personal files and, if you revert back to a previous snapshot, it will delete all the files that you have added or modified since the snapshot. It is designed to do so.


    Imagine the scenario where you take a snapshot one day, download a bunch of photos from your phone or camera on your computer and then, for whatever reason, you revert back to that snapshot. The pictures will be deleted without warning.


    There are better backup solutions for user data, this tool is not intended to do what you are using it for.

    Be careful!

  • @"ftriscari" ALL your points are valid if you use your home account to store your downloads, pictures and important files there. For ALL of that I have and USE OMV NAS data drives (my wife entire Windows account and ALL of her data files are on one of those NAS data drives) as well as second internal drive in my "daily driver" Linux laptop. I do NOT have a "home" on OMV boot drive and I do not understand as to why anyone would. So using "timeshift" is a perfect solution to restore OMV system, not OMV data drives. Just for clarification, I set-up "timeshift" to store snapshots on one of the OMV data drives so even if I reinstall OMV I have a means to run "timeshift" restore right after I mount that drive/file system. It would be great if when you are forced to re-install OMV have a option to run "timeshift", let say, from USB stick that was used to create snapshots. "timeshift" is also a great solution, for me, to restore "root" and "$user" accounts in case of system crash/corruption on any of mine Linux boxes. As I said before, I do not store and of my important data files in "/home/user/"

    You are right that "timeshift" is not a backup system and I agree with you on that, but I do not use "timeshift " as a backup. In OMV I use "rsunc" to backup/mirror my important file/data. to an another drive. You are referring to "better" solutions to do backups, I presume, in OMV for backing up boot drive. Can you name the ones that will do better job as "timeshift" ?. Just keep in mind that I don not have nor keep my personal files on OMV boot drive.

    Linux Mint (Edge) EndeavourOS Arch Linux

    OMV7 NAS, bond0 LACP, Fractal Design Define R5 Case, Kodi "Omega", FreeBSD pfSense Plus firewall/router

    • Official Post

    Most of these points apply to the current openmediavault-backup plugin as well if you put data on the OS drive.


    I have most of a timeshift plugin written. I just need to add a few more features and test. I will release a pre-release version (will start new thread about that) for testing.

    omv 7.4.2-2 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.14 | compose 7.2.1 | k8s 7.2.0-1 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.0.8


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Most of these points apply to the current openmediavault-backup plugin as well if you put data on the OS drive.


    I have most of a timeshift plugin written. I just need to add a few more features and test. I will release a pre-release version (will start new thread about that) for testing.

    I could not be more grateful!

    Thank you so much for the effort and the support to the community.


    :thumbup:

  • Most of these points apply to the current openmediavault-backup plugin as well if you put data on the OS drive.


    I have most of a timeshift plugin written. I just need to add a few more features and test. I will release a pre-release version (will start new thread about that) for testing.

    Why would anyone put data on OMV OS drive?.

    Having timeshift plugin is the best news I heard in a long time in regards to OMV. Thanks so much

    Linux Mint (Edge) EndeavourOS Arch Linux

    OMV7 NAS, bond0 LACP, Fractal Design Define R5 Case, Kodi "Omega", FreeBSD pfSense Plus firewall/router

  • That statement is NOT correct. At least in Ubuntu, it is backing up and restoring ALL files including pictures, music etc. I have set up timeshift to back up all "root" and "user" files and it does just that.

    I think that your statement here confused a bit the situation, including the desktop usage you mentioned.


    no harm done, we are all on the same page 8)


    one key point from me is that we also have a plug-in to use the system drive

    "sharerootfs" and hence extra care is required to ensure that user data is not erroneously being snap-shotted up with timeshift.

    • Official Post

    Why would anyone put data on OMV OS drive?.

    I wish I could answer that : ) I know some people want to run single drive OMV systems. People also use large SSDs for the OS and want to make use of the space.

    Having timeshift plugin is the best news I heard in a long time in regards to OMV.

    I looked at it a couple of years ago but it just never got far. I am trying to model the plugin like the gtk app but definitely open to other ideas.

    omv 7.4.2-2 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.14 | compose 7.2.1 | k8s 7.2.0-1 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.0.8


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Official Post

    one key point from me is that we also have a plug-in to use the system drive

    "sharerootfs" and hence extra care is required to ensure that user data is not erroneously being snap-shotted up with timeshift.

    That is an issue now with the backup plugins. If people choose not to follow advice and/or add those folders to the exclude list, there isn't much we can do.

    omv 7.4.2-2 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.14 | compose 7.2.1 | k8s 7.2.0-1 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.0.8


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • I wish I could answer that : ) I know some people want to run single drive OMV systems. People also use large SSDs for the OS and want to make use of the space.

    I looked at it a couple of years ago but it just never got far. I am trying to model the plugin like the gtk app but definitely open to other ideas.

    1. I think that timeshift should be installed by a default in any new OMV install.

    2. Ability to select "snapshot" from one of internal HD`s or attached USB (stick or drive) even if they are not actually "mounted" yet.

    3. Ability to restore all mountings, file systems, shares (cifs, nfs, Symlinks) services (rsync) , dockers.


    Above is my "wish list" and I have no idea how feasible would it be to implement that.

    Linux Mint (Edge) EndeavourOS Arch Linux

    OMV7 NAS, bond0 LACP, Fractal Design Define R5 Case, Kodi "Omega", FreeBSD pfSense Plus firewall/router

    • Official Post

    I think that timeshift should be installed as a default in any new OMV install.

    It would have to be part of core OMV then.

    Ability to select "snapshot" from one of internal HD`s or attached USB (stick or drive) even if they are not actually "mounted" yet.

    This might be difficult. I don't think the gtk client can do that either.

    Ability to restore all mountings, file systems, shares (cifs, nfs, Symlinks) services (rsync) , dockers.

    Would restoring a snapshot and rebooting do that?

    omv 7.4.2-2 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.14 | compose 7.2.1 | k8s 7.2.0-1 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.0.8


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!