g_it/mobisync
Archived
1
0
Fork 0

Fixing the repo for upload.

This commit is contained in:
g_it 2026-01-28 23:04:29 +01:00
commit 2ff464c7ce
Signed by untrusted user who does not match committer: g_it
GPG key ID: A2B0A7C06A054627
7 changed files with 20 additions and 44 deletions

View file

@ -1,7 +1,7 @@
#!/bin/zsh
# This script syncs an Android with a Mac using adb and adb-sync.
# Version 12.1.2 (09 June 2021)
# Added excluding .DS_Store. Unfortunately can only exclude one file
# Version 13.0 (13 October 2021)
# Replaced adb-sync with timepigeon/adb-sync and delete thumbnails folder before pull
# Export paths for use if the script is turned into an app using Platypus.
export LC_ALL=en_US.UTF-8
@ -48,47 +48,48 @@ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' - >> $LOG # Prints line
}
# Writes the header for the log file: Program, Version number, Date and Line.
{ echo "mobisync 12.1"; echo "Log: " `date`; line; } >> $LOG
{ echo "mobisync 13.0"; echo "Log: " `date`; line; } >> $LOG
# Syncing images and video on device to the Downloads folder on computer.
{
adb shell find "/sdcard/DCIM/" -type f -iname \*.jpg -o -type f -iname \*.mp4 -o -type f -iname \*.dng | tr -d '\015' | while read line; do adb pull "$line" $DOWNLOADS; done;
adb shell find "/sdcard/Pictures/" -type f -iname \*.jpg -o -type f -iname \*.mp4 -o -type f -iname \*.dng | tr -d '\015' | while read line; do adb pull "$line" $DOWNLOADS; done;
adb shell rm -rf "/sdcard/Pictures/.thumbnails/"; adb shell find "/sdcard/Pictures/" -type f -iname \*.jpg -o -type f -iname \*.mp4 -o -type f -iname \*.dng | tr -d '\015' | while read line; do adb pull "$line" $DOWNLOADS; done;
} >> $LOG
catcher Images
line
# Syncing documents on device to the Downloads folder on computer.
{
adb-sync --reverse --times "/sdcard/Documents/Checkin/" ~/Documents/Checkin/;
adb-sync --reverse --times --delete "/sdcard/Documents/Logistics/" ~/Documents/Logistics/;
adb-sync --reverse --times --delete "/sdcard/Documents/Exercise/" ~/Documents/Exercise/;
adb-sync --reverse --times --delete "/sdcard/Documents/Finances/" ~/Documents/Finances/;
adb-sync --exclude .DS_Store --delete ~/Documents/Papers.sparsebundle/ "/sdcard/Documents/Papers.sparsebundle/";
adb-sync --reverse "/sdcard/Download/" $DOWNLOADS;
adb-sync --reverse --delete /sdcard/Documents/Checkin/ ~/Documents/Checkin;
adb-sync --reverse --delete /sdcard/Documents/Logistics/ ~/Documents/Logistics;
adb-sync --reverse --delete /sdcard/Documents/Exercise/ ~/Documents/Exercise;
adb-sync --reverse --delete /sdcard/Documents/Finances/ ~/Documents/Finances;
adb-sync --delete ~/Documents/Papers.sparsebundle/ /sdcard/Documents/Papers.sparsebundle;
adb-sync --reverse /sdcard/Download/ $DOWNLOADS;
adb shell rm -rf /sdcard/Download/*;
} >> $LOG
catcher Documents
line
# Syncing Automate data on device to the computer.
{
adb-sync --two-way --exclude .DS_Store ~/Projects/Programming/push/automate/ "/sdcard/.automate/Interface/";
adb-sync --reverse "/sdcard/.automate/" ~/Mobile/Automate/;
adb-sync -2 --exclude .git ~/Projects/Programming/push/automate /sdcard/.automate/Interface/;
adb-sync --reverse --delete /sdcard/.automate/ ~/Mobile/Automate/;
} >> $LOG
catcher Automate
line
# Syncing app, recovery and backups.
{
adb-sync --reverse "/sdcard/Restore/" ~/Mobile/Restore/;
adb-sync --reverse --times "/sdcard/Backup/" ~/Mobile/Backup/;
adb-sync -2 ~/Mobile/Restore /sdcard/Restore/;
adb-sync --reverse /sdcard/Backup/ ~/Mobile/Backup/;
} >> $LOG
catcher Backup
line
# Syncing Music from the computer.
{
adb-sync --delete --exclude .DS_Store ~/Music/ "/sdcard/Music/";
adb-sync --delete ~/Music /sdcard/Music/;
} >> $LOG
catcher Music
line