blob: 325ab699511507720aae65ff60bb91d02ce5d803 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#!/bin/bash
#
# Custom syncronizer for hydractl sync-media.
#
# Parameters
BASENAME="`basename $0`"
DIRNAME="`dirname $0`"
BASE="`cd $DIRNAME/.. && pwd`"
DEST="$1/data"
ASSETS="$BASE/data"
# Syntax
if [ "$DEST" == "/data" ]; then
echo "usage: $BASENAME <dest>"
exit 1
elif [ ! -d "$DEST" ]; then
echo "folder $DEST does not exist."
exit 1
fi
# Check if there are assets
if [ ! -z "$(ls -A $ASSETS)" ] && [ "$(ls -A $ASSETS)" != ".empty" ]; then
# Then sync
unison $ASSETS $DEST -auto -logfile /dev/null
fi
|