/ missing source dir will lead to exit
sync needs to be started first
This commit is contained in:
@@ -34,8 +34,9 @@ if [[ "${src_dir}" == "${trg_dir}" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if ! [[ -d ${src_dir} ]]; then
|
if ! [[ -d ${src_dir} ]]; then
|
||||||
echo "creating non-existing source directory '${src_dir}'"
|
echo "error: non-existing source directory '${src_dir}'"
|
||||||
mkdir -p ${src_dir}
|
echo "you need to set up sync before you continue!"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! [[ -d ${trg_dir} ]]; then
|
if ! [[ -d ${trg_dir} ]]; then
|
||||||
@@ -51,8 +52,6 @@ if mount | grep ${trg_dir} > /dev/null; then
|
|||||||
else
|
else
|
||||||
echo "mounting source '${src_dir}' to target '${trg_dir}'."
|
echo "mounting source '${src_dir}' to target '${trg_dir}'."
|
||||||
|
|
||||||
# example command:
|
|
||||||
# sudo mount -o bind --source /media/drive2/nass/lo/pCloudSync --target ~/pCloudSync
|
|
||||||
sudo mount -o bind --source ${src_dir} --target ${trg_dir}
|
sudo mount -o bind --source ${src_dir} --target ${trg_dir}
|
||||||
|
|
||||||
du --human-readable --max-depth=1 ${trg_dir}
|
du --human-readable --max-depth=1 ${trg_dir}
|
||||||
|
|||||||
Reference in New Issue
Block a user