ln -sfn "${logs_dir}" "${irclogs_dir}/${shortened_channel_name}"
echo "${login_user}":'{PLAIN}'"${login_pw}" > "${irclogs_pw_dir}/${shortened_channel_name}"
- # If "gpg" line, encrypt old raw logs to that GPG key.
+ # If "gpg_key" line, encrypt old raw logs to that GPG key.
elif [ "${first_word}" = "gpg_key" ]; then
key=$(echo -n "${line}" | cut -d' ' -f2)
mkdir -p ~/plomlombot_db
--- /dev/null
+#!/bin/sh
+# Mirror directory tree from remote to local server, keeping the path.
+set -e
+
+if [ $# -lt 2 ]; then
+ echo "Need server and directory as arguments."
+ false
+fi
+server=$1
+dir=$2
+path_package=/tmp/delete.tar
+
+eval `ssh-agent`
+ssh-add
+cd
+ssh plom@"${server}" "cd \"${dir}\" && tar cf ${path_package} ."
+scp plom@"${server}":"${path_package}" "${path_package}"
+mkdir -p "${dir}"
+cd "${dir}"
+tar xf "${path_package}"
+cd
+rm "${path_package}"
+ssh plom@"${server}" rm "${path_package}"
systemctl enable plomlombot.service
service plomlombot start
+# Migrate borg repo.
+cp "${config_tree_prefix}/setup_scripts/mirror_dir.sh" /home/plom/
+su -lc "./mirror_dir.sh ${old_server} /home/plom/borg" plom
+
+# Clean up
+rm /home/plom/{prepare_to_meet_server,mirror_dir}.sh
+
# TODO:
# - commit git-daemon-export-ok directly into the public repos; rename
# /home/plom/public_repos to /home/plom/repos