Compare commits
3 Commits
b267c83fd9
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
f16e9fc9ae | ||
|
bd0396af1d | ||
|
70daa2f8a3 |
@@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
Painlessly sync your music (or other files) to an Android device.
|
Painlessly sync your music (or other files) to an Android device.
|
||||||
|
|
||||||
Just plug in your phone, give file transfer permission and run the script. Requires libmtp and GIO.
|
Just plug in your phone, give file transfer permission and run the script. Requires rsync, libmtp and GIO.
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
###BEGIN CONFIGURATION###
|
###BEGIN CONFIGURATION###
|
||||||
SOURCE_DIR="$HOME/Music/"
|
SOURCE_DIR="$HOME/Music/"
|
||||||
DEST_DIR="Internal shared storage/Music/"
|
DEST_DIR="Internal shared storage/Music/Synced/"
|
||||||
###END CONFIGURATION###
|
###END CONFIGURATION###
|
||||||
|
|
||||||
UID=$(id -u -r)
|
UID=$(id -u -r)
|
||||||
@@ -21,6 +21,7 @@ get_mtp_dir() {
|
|||||||
[ -d "$mtpdir" ] && echo "$mtpdir"
|
[ -d "$mtpdir" ] && echo "$mtpdir"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ -z "$1" ] && info "Any arguments are passed to rsync."
|
||||||
info "Configuration: 💻:'$SOURCE_DIR' -> 📱:'$DEST_DIR'."
|
info "Configuration: 💻:'$SOURCE_DIR' -> 📱:'$DEST_DIR'."
|
||||||
|
|
||||||
[ ! -d "$SOURCE_DIR" ] && die "The specified source directory '$SOURCE_DIR' does not exist!"
|
[ ! -d "$SOURCE_DIR" ] && die "The specified source directory '$SOURCE_DIR' does not exist!"
|
||||||
@@ -43,6 +44,9 @@ rsync --progress \
|
|||||||
--recursive \
|
--recursive \
|
||||||
--inplace \
|
--inplace \
|
||||||
--exclude='*.parts' \
|
--exclude='*.parts' \
|
||||||
|
--exclude='*.m3u' \
|
||||||
|
--delete \
|
||||||
|
"$@" \
|
||||||
"$SOURCE_DIR" "$(get_mtp_dir)/$DEST_DIR" \
|
"$SOURCE_DIR" "$(get_mtp_dir)/$DEST_DIR" \
|
||||||
&& info "Success!" \
|
&& info "Success!" \
|
||||||
|| die "Error synchronizing files!"
|
|| die "Error synchronizing files!"
|
||||||
|
Reference in New Issue
Block a user