Compile Timeshift on Solus Linux (2017.04.18.0)

Recently I switched to Solus Linux to try it out for a few weeks. Coming from Ubuntu I was used to regular system backups performed by Timeshift.

Sadly the latest installer from Github installs binaries depending on an old version of libvte. So I got this error message:

Luckily this is an open source project so we can compile it ourselves:

But now another error stops the compilation:

So I googled the error (I am not a Vala dev myself) and it turned out to be an incompatibility with the newer Vala version on my system (0.36.3).

So I had to go to Gtk/ExcludeBox.vala line 301 and replace it with

Besides a lot of warnings the compilation went smoothly after that. Timeshift then showed up in the application menu and I could start it and make a backup. The only annoyance is a weirdly looking cursor when moving it inside the window. But after the initial configuration I rarely open timeshift anyway 🙂

Edit: A few weeks after installation I noticed, that scheduled backups are not done automatically. After some digging around I found out the reason:

Solus does not use the cron daemon anymore. Instead it uses systemd timers. But timeshift does rely on cron.  So first we need to know what to run to create a backup if scheduled:

If a backup already has been made for this time period, another one won’t be created. So it is safe to run this command more frequently than necessary. So when do we need to run this command? We should run it after boot and also daily.  Then we should never miss a scheduled backup.

To implement this create the following files:

Both /etc/systemd/system/timeshift-boot.service and /etc/systemd/system/timeshift-daily.service

/etc/systemd/system/timeshift-boot.timer

Note: “OnBootSec” sets the time systemd waits after boot before doing the backup. You can adapt the time to your needs.

/etc/systemd/system/timeshift-daily.timer

When you are done run

Now scheduled backups should be created automatically.

14 thoughts on “Compile Timeshift on Solus Linux (2017.04.18.0)”

  1. Thanks for your tutorial! However, I am not very familiar with building things on Linux and unlike you, I run into many more errors after fixing the vala line. First one was resolved by installed gcc, then I also had to install some libs, I don’t even know which one did the trick.
    Now I am stuck here though:

    […]
    In file included from /usr/include/glib-2.0/glib/gtypes.h:32:0,
    from /usr/include/glib-2.0/glib/galloca.h:32,
    from /usr/include/glib-2.0/glib.h:30,
    from /home/pcmciakai/timeshift/src/Gtk/SnapshotListBox.vala.c:27:
    /usr/include/glib-2.0/glibconfig.h:1:27: fatal error: bits/wordsize.h: No such file or directory
    #include
    ^
    compilation terminated.
    error: cc exited with status 256
    […]

    Do you reckon you could help me out of this?

    Best wishes,
    Kai

    1. Hello Kai,
      I updated my article to install gcc and the extra lib you need: glibc-devel.
      You can find packages containing missing files by running:

      eopkg search-file filename

      In this case I ran “eopkg search-file wordsize.h” and it returned glibc-devel. Please tell me how it went 🙂

      Btw congrats to the first comment on my blog 😀

      1. Thank you very much for your help!

        I installed glibc-devel and restarted the building. It stopped at the missing file linux/limits.h
        I then wanted to try the eopkg search-file command but I found out it only finds files which are already installed on your system. I took a wild guess, however, and installed the linux-headers package. Surprisingly it worked and the building could complete!

        Timeshift also appeared in my start menu, but upon starting I got the following message: http://puu.sh/xj8nH/5cc2e6d3ba.png and that was about it. 🙁 I hope you’ve got any idea about what could still be missing!

        1. I did not know that eopkg only searches installed packages. Thanks for the hint 🙂
          I updated the post with the linux-headers package. I always have this one installed so I forgot to mention it.
          Regarding your problem: Can you run timeshift from a terminal and post a pastebin link of the terminal output here?

          1. Silly me, that I did not think of this myself! As I ran timeshift-launcher with the terminal, I realised I was missing the most important thing for timeshift: rsync! No wonder it wouldn’t accept that.

            Now the GUI runs, even with the funky mouse cursor, as described in your post. 😀

            A similar error was created when I pressed BTRFS instead of rsync. Not that this is really needed for the normal usage, but this could be fixed by installing btrfs-progs!

            Thanks again for your help!

  2. I was just trying to install timeshift onto my fathers laptop with your updated guide and noticed, that “pkg-config” is also necessary for building! 😉

  3. Something must have changed on the system. Trying to install today resulted in the following errors. No idea what is going on and Google doesn’t really help me either. 🙁 Have you got any ideas?

    [code]
    e751@e751 ~/timeshift/src $ sudo make && sudo make install
    Password:
    #timeshift-gtk
    valac -X -D’GETTEXT_PACKAGE=”timeshift”‘ –Xcc=”-lm” -X -Wl,-rpath,/usr/share/timeshift/libs -D VTE_291 -D GTK3_18 –thread Core/*.vala Utility/*.vala Utility/Gtk/*.vala Gtk/*.vala -o timeshift-gtk –pkg glib-2.0 –pkg gio-unix-2.0 –pkg posix –pkg gtk+-3.0 –pkg vte-2.91 –pkg gee-0.8 –pkg json-glib-1.0 –pkg libsoup-2.4 #–target-glib=2.32 –pkg libsoup-2.4 –pkg libxml-2.0
    Utility/TimeoutCounter.vala:47.4-47.22: warning: GLib.Thread.create has been deprecated since 2.32. Use new Thread ()
    Utility/TimeoutCounter.vala:61.4-61.22: warning: GLib.Thread.create has been deprecated since 2.32. Use new Thread ()
    Utility/AsyncTask.vala:146.5-146.23: warning: GLib.Thread.create has been deprecated since 2.32. Use new Thread ()
    Utility/AsyncTask.vala:154.5-154.23: warning: GLib.Thread.create has been deprecated since 2.32. Use new Thread ()
    Core/Main.vala:3512.4-3512.22: warning: GLib.Thread.create has been deprecated since 2.32. Use new Thread ()
    Core/SnapshotRepo.vala:890.4-890.22: warning: GLib.Thread.create has been deprecated since 2.32. Use new Thread ()
    Utility/GtkHelper.vala:41.13-41.48: warning: Gdk.Cursor.new has been deprecated since 3.16
    Utility/GtkHelper.vala:44.13-44.48: warning: Gdk.Cursor.new has been deprecated since 3.16
    Core/Main.vala:3390.4-3390.22: warning: GLib.Thread.create has been deprecated since 2.32. Use new Thread ()
    Core/Main.vala:1377.4-1377.22: warning: GLib.Thread.create has been deprecated since 2.32. Use new Thread ()
    Core/Main.vala:1845.5-1845.23: warning: GLib.Thread.create has been deprecated since 2.32. Use new Thread ()
    Core/Main.vala:1848.5-1848.23: warning: GLib.Thread.create has been deprecated since 2.32. Use new Thread ()
    Utility/Gtk/TerminalWindow.vala:137.4-137.18: warning: Vte.Terminal.spawn_sync has been deprecated since 0.48
    Utility/Gtk/TerminalWindow.vala:183.4-183.18: warning: Vte.Terminal.spawn_sync has been deprecated since 0.48
    Utility/GtkHelper.vala:354.3-354.26: warning: Gtk.Widget.override_color has been deprecated since 3.16
    Utility/IconManager.vala:48.20-48.47: error: The name file_resolve_executable_path' does not exist in the context of IconManager.init’
    string binpath = file_resolve_executable_path(args[0]);
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    Utility/TeeJee.System.vala:225.10-225.43: warning: Gdk.Screen.get_width has been deprecated since 3.22
    Utility/TeeJee.System.vala:229.10-229.44: warning: Gdk.Screen.get_height has been deprecated since 3.22
    Gtk/EstimateBox.vala:91.5-91.23: warning: GLib.Thread.create has been deprecated since 2.32. Use new Thread ()
    Gtk/BackupBox.vala:167.4-167.22: warning: GLib.Thread.create has been deprecated since 2.32. Use new Thread ()
    Gtk/RestoreBox.vala:182.4-182.22: warning: GLib.Thread.create has been deprecated since 2.32. Use new Thread ()
    Gtk/RsyncLogWindow.vala:167.4-167.22: warning: GLib.Thread.create has been deprecated since 2.32. Use new Thread ()
    Gtk/UsersBox.vala:247.4-247.25: error: The name include_btrfs_home' does not exist in the context of Main’
    App.include_btrfs_home = chk_include_btrfs_home.active;
    ^^^^^^^^^^^^^^^^^^^^^^
    Gtk/UsersBox.vala:266.36-266.57: error: The name include_btrfs_home' does not exist in the context of Main’
    chk_include_btrfs_home.active = App.include_btrfs_home;
    ^^^^^^^^^^^^^^^^^^^^^^
    Gtk/UsersBox.vala:291.23-291.46: error: The name current_system_users' does not exist in the context of Main’
    foreach(var user in App.current_system_users.values){
    ^^^^^^^^^^^^^^^^^^^^^^^^
    Compilation failed: 4 error(s), 21 warning(s)
    make: *** [makefile:27: all] Error 1
    [/code]

  4. Thank you for the instructions on how to build TimeShift for Solus linux.
    It works great (the building process and the TimeShift application)!

  5. Thanks also for your instructions. Worked like a charm after installing the right packages.
    How could I enable the German language for it? I saw on Github that there is something about de po file

    1. I want to add something that you should add to your article maybe as per default Timeshift seems to backup it’s own backup folder which leads to unnecessary big data. Found in a comment on https://www.maketecheasier.com/backup-computer-timeshift-linux-mint/#comment-66473

      Against what this user is telling it is of course possible to exclude files and folders manually and this is what I did so to avoid backing up the backup data. ^^

      Other question:
      How to update Timeshift regularly? Just compile it new each time and “replace” it without taking care of something or what? I’m quite new to Linux so not sure.

      1. Hi,

        thank you for the hint about the backup folder.
        Since there is no Timeshift package for Solus wich auto updates your installation, you have to compile and install Timeshift each time a new version comes out.
        But the changes are often mininmal so I usually do not update Timeshift very often.

Leave a Comment

Your email address will not be published. Required fields are marked *