1

I was running a backup with tar in the terminal and locked my screen before leaving my system for a short while. After I returned tar had stopped archiving my files.

Why did tar stop working after I locked my screen even though I didnt close the laptop lid to shut it down?

Is there a way to resume the backup? The process hasn't been killed and it had gone really far so maybe there's a way.

I started the backup with: tar --exclude={File1,File2,File3} -cvpjf backup.tar.bz .

I noticed the backup had stopped when I returned and unlocked my screen. I had been gone for almost 20 minutes and I saw that the cursor in the terminal was static. It was no longer printing output to show what tar was doing according to verbose mode. Instead it has that blinking cursor you get when you are typing a comment and the the cursor (" | ") keeps blinking.

update

I stopped the backup with the shortcut Ctrl + Z. Then I tried resuming the backup with the command fg but it failed to resume and returned this output:

tar --exclude={File1,File2,File3} -cvpjf backup.tar.bz .

tar: ./WindowsImageBackup/DESKTOP-IASDK/Backup 2018-05-14 102113/b7230501-0000-0000-0000-501f00000000.vhdx: Read error at byte 66575985152, while reading 10240 bytes: Input/output error

bzip2: I/O or other error, bailing out.  Possible reason follows.
bzip2: Input/output error
    Input file = (stdin), output file = (stdout)
tar: backup.tar.bz2: Wrote only 8192 of 10240 bytes
tar: Child returned status 1
tar: Error is not recoverable: exiting now

Just to mention, that last ID the error shows i.e. tar: ./WindowsImageBackup/DESKTOP-IASDK/Backup 2018-05-14 102113/b7230501-0000-0000-0000-501f00000000.vhdx: Read error at byte 66575985152, while reading 10240 bytes: Input/output error is the last line the terminal printed before I locked my screen. This confirms that locking my screen did stop the archive process because I intervened by using Ctrl + Z atleast 2 hrs after the last line was printed.

1
  • Comments are not for extended discussion; this conversation has been moved to chat.
    – terdon
    Commented May 21, 2018 at 17:14

1 Answer 1

0

You have options between nohup or using the disown function. I think this might be of great help to you:

https://serverfault.com/a/311737/318311

I understand this is discussing logouts, and you are gearing your question towards the locking the screen, however this should remain applicable.

2
  • This is not a good answer. You failed to mention that nohup and disown do not send stdout to the terminal. The provided link also wasn't explicit. It is important to know the ETA when transferring large files.
    – bit
    Commented May 23, 2018 at 18:46
  • Answer should be sufficient, just need to do some more detective work yourself to tailor your needs accordingly: nohup tar -cvzf tartest.tar.gz tartest 2>&1 > outputinfo.txt &. cat outputinfo.txt would give you the info you need on the files processed. The nohup man page can also guide you along. Also, you can pop open another terminal session and run tail -f nohup.out to get real time info.
    – Kahn
    Commented May 24, 2018 at 20:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .