Last night I tried to run a long file extraction script (should have taken at least 12 hours to complete) on 60+ large files.
Now in the morning, only 12 of the files restored successfully and the operation is not running. The structure of the command was:
sudo restic -r /data/extdrive/restic-repo restore 8c6d5ab2 --target /data/extdrive/dump --password-file /data/sdcard/documents/resticpass.txt --include '/srv/dev-disk-by-uuid-84475483-4c80-4f1d-a765-e6918b958631/documents/foo.mp4"
My nohup is full of fatal errors like:
ignoring error for dir1: chmod dir1: operation not permitted
ignoring error for dir1: lchown dir1: operation not permitted
Over and over again until the script quit, I guess.
Any ideas on what might have happened here? Sudo time out or something? Can sudo permission timer run out during scripts?
dir1, can you isolate it to some specific command? Do you have logs from ll the commands?
I just tried it again, here’s full nohup.out:
ignoring error for /srv/dev-disk-by-uuid-84475483-4c80-4f1d-a765-e6918b958631/Torrents/Movies/21.Jump.Street.2012.720p.BluRay.DTS.x264-HiDt/21.Jump.Street.2012.720p.BluRay.DTS.x264-HiDt.mkv: lchown /data/extdrive/dump/srv/dev-disk-by-uuid-84475483-4c80-4f1d-a765-e6918b958631/Torrents/Movies/21.Jump.Street.2012.720p>
ignoring error for /srv/dev-disk-by-uuid-84475483-4c80-4f1d-a765-e6918b958631/Torrents/Movies/21.Jump.Street.2012.720p.BluRay.DTS.x264-HiDt/21.Jump.Street.2012.720p.BluRay.DTS.x264-HiDt.nfo: lchown /data/extdrive/dump/srv/dev-disk-by-uuid-84475483-4c80-4f1d-a765-e6918b958631/Torrents/Movies/21.Jump.Street.2012.720p>
ignoring error for /srv/dev-disk-by-uuid-84475483-4c80-4f1d-a765-e6918b958631/Torrents/Movies/21.Jump.Street.2012.720p.BluRay.DTS.x264-HiDt: chmod /data/extdrive/dump/srv/dev-disk-by-uuid-84475483-4c80-4f1d-a765-e6918b958631/Torrents/Movies/21.Jump.Street.2012.720p.BluRay.DTS.x264-HiDt: operation not permitted
ignoring error for /srv/dev-disk-by-uuid-84475483-4c80-4f1d-a765-e6918b958631/Torrents/Movies: chmod /data/extdrive/dump/srv/dev-disk-by-uuid-84475483-4c80-4f1d-a765-e6918b958631/Torrents/Movies: operation not permitted
ignoring error for /srv/dev-disk-by-uuid-84475483-4c80-4f1d-a765-e6918b958631/Torrents: chmod /data/extdrive/dump/srv/dev-disk-by-uuid-84475483-4c80-4f1d-a765-e6918b958631/Torrents: operation not permitted
ignoring error for /srv/dev-disk-by-uuid-84475483-4c80-4f1d-a765-e6918b958631: lchown /data/extdrive/dump/srv/dev-disk-by-uuid-84475483-4c80-4f1d-a765-e6918b958631: operation not permitted
Summary: Restored 3 files/dirs (4.367 GiB) in 7:03
Fatal: There were 6 errors
extract.sh: line 57: unexpected EOF while looking for matching `''
extract.sh: line 58: syntax error: unexpected end of file
This was an attempt to run the command using
sudo nohup bash extract.sh
I get the same result as either regular user or root. Here is the entire script in all of its glory, showing that there should not be any mismatched apostrophes.
update: Even though bash documentation quoting section seems to directly imply that you are allowed to use escape character \ for special characters, this is apparently false, so my \! and \’ in there were not actually working, hence the unexpected EOF.
The chmod and chown commands are failing because the drive is exFAT and extracting to itself, which does not allow changing of permissions.
I’ll report back tomorrow and see what happens if I just straight up replace the single quotes with double quotes.