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

backup.sh always fails with"tar: This does not look like a tar archive" #29

Closed
wolkenkuckuck opened this issue Oct 5, 2022 · 2 comments

Comments

@wolkenkuckuck
Copy link

Hello,

I have been trying to use your LAB tool since I have read about it in an article of the German LinuxUser magazine ed. 09/2022 pp. 18-22 by Ferdinand Thommes, but so far it always aborts with below error, right after tentative storage of apk files for installed apps.

Is this a known issue with an effective fix or workaround?

Regards,
Ralph

7.56MiB 0:00:01 [7.36MiB/s] [ <=> ]
55.3MiB 0:00:07 [7.57MiB/s] [ <=> ]
6.17MiB 0:00:00 [7.36MiB/s] [<=> ]
2.69MiB 0:00:00 [6.96MiB/s] [<=> ]
110MiB 0:00:12 [8.59MiB/s] [ <=> ]
1.91MiB 0:00:00 [5.93MiB/s] [<=> ]
3.94MiB 0:00:01 [3.58MiB/s] [ <=> ]
91.0MiB 0:00:10 [8.66MiB/s] [ <=> ]
Exporting contacts (as vCard).
0.00 B 0:00:00 [0.00 B/s] [<=> ]
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors

[fiddle@lenolap:~/LU/202209]
$ ls backup-tmp/Apps/|grep -Ec [0-9]+\.apk
128

[fiddle@lenolap:~/LU/202209]
$ du -shx backup-tmp/Apps/
3.4G backup-tmp/Apps/

[fiddle@lenolap:~/LU/202209]
$ ll backup-tmp/Contacts/
total 0

@mrrfv
Copy link
Owner

mrrfv commented Oct 6, 2022

It indeed is a known issue with an easy to use workaround. It seems like your computer isn't 100% compatible with the tar binary that's on your phone, so you have to pick the adb export method when asked by the script. It's very odd that the script was able to export the apps before failing though; do you have any contacts saved on the device, and did you export them with the companion app when asked by the script?

@wolkenkuckuck
Copy link
Author

@mrrfv thank you for your reply.
I think my issue was that the external usb hdd where I wanted my phone backup to be written to spinned down after a certain period of assumed inactivity.
Unfortunately, as this is a cheap device, it couldn't be prevented from doing so by sdparms with an e.g. --clear=STANDBY.
But what helped was a cronjob that touched a partition of the device every 5 minutes.
Because of the great amount of data on my phone the backup ran all night.

[fiddle@lenolap:~/lab]
$ sudo crontab -l
*/5 * * * * bash -c '{ lsblk -no name /dev/sdb3 && touch /dev/sdb3; } &>/dev/null'

[fiddle@lenolap:~]
$ df -hP ~fiddle/lab/ ~fiddle/lab/diensthandy/
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_usb-lv_tmp 127G 25M 121G 1% /home/fiddle/lab
/dev/mapper/vg_usb-lv_diensthandy 127G 46G 75G 39% /home/fiddle/lab/diensthandy

[fiddle@lenolap:~]
$ ls -lh /home/fiddle/lab/diensthandy
total 46G
-rw-rw-r--. 1 fiddle fiddle 46G Oct 10 08:58 linux-android-backup-10-10-2022-02-35-32.7z
drwx------. 2 root root 16K Oct 3 21:55 lost+found

tail of backup.sh output:

emoving backup-tmp/Storage/Schedule
Removing backup-tmp/Storage/Podcasts
Removing backup-tmp/Storage/Ringtones
Removing backup-tmp/Apps
Removing backup-tmp/Contacts
Removing backup-tmp/Storage

Everything is Ok
Backed up successfully.
If this project helped you, please star the GitHub repository. It lets me know that there are people using this script and I should continue working on it.

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

2 participants