home · contact · privacy
Update mpv config.
[config] / bookworm / setup_scripts / mirror_dir.sh
1 #!/bin/sh
2 # Mirror directory tree from remote to local server, keeping the path.
3 set -e
4 . ./misc.sh
5 . ../../misc.sh
6
7 expect_n_args 2 "(server, directory)" "$@"
8 server=$1
9 dir=$2
10 path_package=/tmp/delete.tar
11
12 eval `ssh-agent`
13 ssh-add
14 cd
15 ssh plom@"${server}" "cd \"${dir}\" && tar cf ${path_package} ."
16 scp plom@"${server}":"${path_package}" "${path_package}"
17 mkdir -p "${dir}"
18 cd "${dir}"
19 tar xf "${path_package}"
20 cd
21 rm "${path_package}"
22 ssh plom@"${server}" rm "${path_package}"