DEV Community

Discussion on: How to Use Timeshift from Command Line in Linux

Collapse
 
rahedmir profile image
Mir Rahed Uddin • Edited

I am not sure though but it should be something like this...
sudo timeshift --create --comments "new backup" --tags D --snapshot-device /dev/sda1
(/dev/sda1 is an example of your target device location)

Collapse
 
kicey profile image
Kicey

Otherwise, you can edit the config file in /etc/timeshift/timeshift.json to change the default target.

Thread Thread
 
thumbone profile image
Bernd Wechner

Curiously I installed timeshift on an Ubuntu server:

sudo apt install timeshift

and I find two config file candidates:

$ ll /etc/timeshift*
-rw-r--r-- 1 root root  548 Mar 16  2020 /etc/timeshift.json

/etc/timeshift:
total 20
drwxr-xr-x   2 root root  4096 Oct 26 10:25 ./
drwxr-xr-x 137 root root 12288 Oct 26 12:22 ../
-rw-r--r--   1 root root   548 Mar 16  2020 timeshift.json
Enter fullscreen mode Exit fullscreen mode

with puzzling dates no less. And the contents are far from clear or well documented anywhere:

$ cat /etc/timeshift.json 
{
  "backup_device_uuid" : "",
  "parent_device_uuid" : "",
  "do_first_run" : "true",
  "btrfs_mode" : "false",
  "include_btrfs_home" : "false",
  "stop_cron_emails" : "true",
  "schedule_monthly" : "false",
  "schedule_weekly" : "false",
  "schedule_daily" : "false",
  "schedule_hourly" : "false",
  "schedule_boot" : "false",
  "count_monthly" : "2",
  "count_weekly" : "3",
  "count_daily" : "5",
  "count_hourly" : "6",
  "count_boot" : "5",
  "snapshot_size" : "0",
  "snapshot_count" : "0",
  "exclude" : [
  ],
  "exclude-apps" : [
  ]
}
Enter fullscreen mode Exit fullscreen mode

albeit identical in the two files. I find the dearth of documentation here:

github.com/teejee2008/timeshift

on the config file (location and contents) mildly frustrating (but not totally surprising or disconcerting as it is FOSS and I know the deal and am overridingly grateful just for its existence and reliability).

But the most interesting thing, and real reason I drop comment here is that the config file lacks any evidence of snapshot-device having only backup_device_uuid (which I might infer - though would prefer to see documented - is the device that is being backed up not the device being backed up to - the source, not the destination). And I might guess further that adding snapshot-device to the config file might work, but would remain curious if we can't specify a target folder (rather than device).