teejee2008 / timeshift

System restore tool for Linux. Creates filesystem snapshots using rsync+hardlinks, or BTRFS snapshots. Supports scheduled snapshots, multiple backup levels, and exclude filters. Snapshots can be restored while system is running or from Live CD/USB.
GNU Lesser General Public License v3.0
4.7k stars 282 forks source link

Last date of a snapshot in command line #273

Open servimo opened 6 years ago

servimo commented 6 years ago

There's a way to know the date of the last snapshot in command line? I want the result of this command for use in Conky. Or just open a terminal and type it. Maybe is simple, but my knowhow of linux is not good. When I use "timeshift --list" it shows all snapshots and this:

$ timeshift --list Application needs admin access. Please run the application as admin (using 'sudo' or 'su')

(process:9835): CRITICAL : 14:24:30.778: main_exit_app: assertion 'self != NULL' failed E: Error opening file “/var/log/timeshift/2018-08-06_14-24-30_list-snapshots.log”: Permission denied E: Error opening file “/var/run/lock/timeshift/lock”: Permission denied E: Failed to write file: /var/run/lock/timeshift/lock E: Failed to open file “/etc/crypttab”: Permission denied E: Failed to read file: /etc/crypttab

(process:9835): GLib-CRITICAL **: 14:24:30.838: g_strsplit: assertion 'string != NULL' failed E: Failed to open file “/HD.Interno/timeshift/snapshots/2018-08-04_00-00-02/localhost/etc/crypttab”: Permission denied E: Failed to read file: /HD.Interno/timeshift/snapshots/2018-08-04_00-00-02/localhost/etc/crypttab

(process:9835): GLib-CRITICAL **: 14:24:30.844: g_strsplit: assertion 'string != NULL' failed E: Failed to open file “/HD.Interno/timeshift/snapshots/2018-08-06_09-00-01/localhost/etc/crypttab”: Permission denied E: Failed to read file: /HD.Interno/timeshift/snapshots/2018-08-06_09-00-01/localhost/etc/crypttab

(process:9835): GLib-CRITICAL **: 14:24:30.846: g_strsplit: assertion 'string != NULL' failed E: Failed to open file “/HD.Interno/timeshift/snapshots/2018-08-01_16-00-02/localhost/etc/crypttab”: Permission denied E: Failed to read file: /HD.Interno/timeshift/snapshots/2018-08-01_16-00-02/localhost/etc/crypttab

(process:9835): GLib-CRITICAL **: 14:24:30.847: g_strsplit: assertion 'string != NULL' failed E: Failed to open file “/HD.Interno/timeshift/snapshots/2018-08-02_16-00-01/localhost/etc/crypttab”: Permission denied E: Failed to read file: /HD.Interno/timeshift/snapshots/2018-08-02_16-00-01/localhost/etc/crypttab

(process:9835): GLib-CRITICAL **: 14:24:30.849: g_strsplit: assertion 'string != NULL' failed Device : /dev/sdb1 UUID : 9deb02ee-01f3-4af4-8a78-e81b27110035 Path : /HD.Interno Mode : RSYNC Device is OK 4 snapshots, 74.9 GB free

Num Name Tags Description

0 > 2018-08-01_16-00-02 D
1 > 2018-08-02_16-00-01 D
2 > 2018-08-04_00-00-02 D
3 > 2018-08-06_09-00-01 D

teejee2008 commented 6 years ago

You can parse it from output of "snapshot --list". A command line option can also be added.