local/bin/homesync: Let user set path where data is looked up for indexing
parent
bcc9f0a225
commit
337860b725
|
@ -5,11 +5,15 @@ usage() {
|
|||
Usage: ${0##*/}
|
||||
|
||||
Sync home folder.
|
||||
Data is indexed to ~/personal/index.
|
||||
|
||||
The '~/.gnupg' folder can be backup up to a LUKS encrypted device.
|
||||
|
||||
Options:
|
||||
|
||||
-p: Push upstream.
|
||||
-d DEVICE: Device where to store ~/.gnupg
|
||||
-d PATH: where the data is looked up for indexing.
|
||||
-g DEVICE: Device where to store ~/.gnupg
|
||||
-p: Push upstream.
|
||||
|
||||
EOF
|
||||
exit
|
||||
|
@ -17,14 +21,17 @@ EOF
|
|||
|
||||
OPT_UPDATE=false
|
||||
OPT_DEVICE=""
|
||||
while getopts ":hd:p" opt; do
|
||||
OPT_DATAROOT=$(findmnt -n --fstab --output TARGET | grep ^/media/)
|
||||
while getopts ":hd:g:p" opt; do
|
||||
case $opt in
|
||||
h)
|
||||
usage
|
||||
exit ;;
|
||||
d)
|
||||
OPT_DATAROOT="$OPTARG" ;;
|
||||
p)
|
||||
OPT_UPDATE=true ;;
|
||||
d)
|
||||
g)
|
||||
OPT_DEVICE="$OPTARG" ;;
|
||||
\?)
|
||||
usage
|
||||
|
@ -52,8 +59,7 @@ message() {
|
|||
}
|
||||
|
||||
section Data index
|
||||
DATAROOT=/media/$(ls -1 /media)
|
||||
for i in "$DATAROOT"/*; do
|
||||
for i in "$OPT_DATAROOT"/*; do
|
||||
mkdir -p ~/personal/index/
|
||||
case "$i" in
|
||||
*/locate.db|*/lost+found|*/Sync*)
|
||||
|
|
Loading…
Reference in New Issue