Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to check backup progress? #54

Open
Mastergalen opened this issue Sep 18, 2020 · 2 comments
Open

How to check backup progress? #54

Mastergalen opened this issue Sep 18, 2020 · 2 comments

Comments

@Mastergalen
Copy link

I would like to check the progress of my backups but have been unable to get the progress to print using SIGUSR1, as documented in the restic docs.

Additionally on Unix systems if restic receives a SIGUSR1 signal the current progress will be written to the standard output so you can check up on the status at will.

The steps I followed inside the Docker container are:

/home # ps aux
PID   USER     TIME  COMMAND
    1 root      0:01 tail -fn0 /var/log/cron.log
   40 root      0:00 crond
   41 root      0:00 ash
   46 root      0:21 ash
   91 root      0:00 /usr/bin/flock -n /var/run/backup.lock /bin/backup
   92 root      0:00 {backup} /bin/sh /bin/backup
   97 root      0:00 restic backup /data --exclude="@eaDir/" --tag=
  106 root      0:00 rclone serve restic --stdio --b2-hard-delete --drive-use-trash=fa
  123 root      0:00 ps aux

Send SIGUSR1 signal to PID 97

kill -SIGUSR1 97

No progress is printed to /var/log/cron.log.

I also tried viewing stdout for PID 97 with tail -f /proc/97/fd/1, but still nothing, unfortunately.

@jonpavelich
Copy link

I encountered the same issue. It looks like restic output is written to /var/log/backup-last.log rather than /var/log/cron.log. After sending a SIGUSR1 signal to the restic process, I was able to view the progress report in /var/log/backup-last.log.

@koelle25
Copy link
Contributor

koelle25 commented Sep 9, 2023

I encountered the same issue. It looks like restic output is written to /var/log/backup-last.log rather than /var/log/cron.log. After sending a SIGUSR1 signal to the restic process, I was able to view the progress report in /var/log/backup-last.log.

Thanks! For others also wanting to check progress, here's how to do it. You can execute the commands directly on the host system (you don't need to be inside the container for this to work):

  1. Find PID of the restic process. You can either try using pgrep -f restic or pidof restic, or use the "raw" method of ps -ef | grep "[r]estic" (the encased [r] will make it so you only get the line with the actual restic process, but not the current "grep restic" process line). Example output:
root@ubuntu:~# ps -ef | grep -E "[r]estic"
root     23852 23847  2 05:59 ?        00:12:58 restic backup /data --tag=
  1. Send the signal: kill -SIGUSR1 <pid>, so for the example above it would be kill -SIGUSR1 23852 (23847 would be the parent process PID (PPID)).
  2. Check the log: docker exec <container-name> tail /var/log/backup-last.log, e.g.:
root@ubuntu:~# docker exec restic-backup tail /var/log/backup-last.log
...
[7:59:38] 20.61%  102383 files 66.617 GiB, total 380366 files 323.189 GiB, 0 errors ETA 80:29:11
/data/backup/appdata/ab_20230906_010003/plex.tar.gz
/data/backup/appdata/ab_20230907_010001/nextcloud.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants