diff --git a/templates/mariadb_backup/listusers.erb.sh b/templates/mariadb_backup/listusers.erb.sh index 1b6fc8a..edf768f 100644 --- a/templates/mariadb_backup/listusers.erb.sh +++ b/templates/mariadb_backup/listusers.erb.sh @@ -34,7 +34,7 @@ if ! jq . "${customer_dir}/users.json" &>/dev/null; then fi if [[ ${status} -eq 0 ]]; then # something is wrong if we cant copy the file in 30 seconds, so we should note that - if ! timeout 30s rclone copy --no-check-certificate --webdav-headers "Host,sunet.drive.sunet.se" --use-cookies "${customer_dir}/users.json" "${base_dir}/${location}/"; then + if ! timeout 30s rclone copy -c --no-check-certificate --webdav-headers "Host,sunet.drive.sunet.se" --use-cookies "${customer_dir}/users.json" "${base_dir}/${location}/"; then status=1 fi fi diff --git a/templates/script/aggregate.sh b/templates/script/aggregate.sh index 6459fcf..d5e8798 100644 --- a/templates/script/aggregate.sh +++ b/templates/script/aggregate.sh @@ -34,14 +34,14 @@ done for customer in $(${yq} -r '.singlenodes | .[]' ${commonyaml}); do product=2 # Prisplan 2 csv="${csv} -$(rclone --no-check-certificate --webdav-headers "Host,sunet.drive.sunet.se" --use-cookies cat "${billingbucket}/${customer}-usage/${customer}-latest.csv" | +$(rclone cat --no-check-certificate --webdav-headers "Host,sunet.drive.sunet.se" --use-cookies "${billingbucket}/${customer}-usage/${customer}-latest.csv" | grep -E -v '^DATE|^Customer' | sed 's/$/;'${product}'/')" done echo "${csv}" >"${aggregatefile}" -rclone copy --no-check-certificate --webdav-headers "Host,sunet.drive.sunet.se" --use-cookies "${aggregatefile}" "${aggregatedir}/" +rclone copy -c --no-check-certificate --webdav-headers "Host,sunet.drive.sunet.se" --use-cookies "${aggregatefile}" "${aggregatedir}/" mv "${aggregatefile}" "latest.csv" -rclone move --no-check-certificate --webdav-headers "Host,sunet.drive.sunet.se" --use-cookies "latest.csv" "${latestdir}/" +rclone move -c --no-check-certificate --webdav-headers "Host,sunet.drive.sunet.se" --use-cookies "latest.csv" "${latestdir}/" cd "${olddir}" || (echo "Could not switch back to old dir" && exit 1) rmdir "${tempdir}" diff --git a/templates/script/listusers.erb.sh b/templates/script/listusers.erb.sh index 5243c9d..9e338bc 100644 --- a/templates/script/listusers.erb.sh +++ b/templates/script/listusers.erb.sh @@ -16,7 +16,7 @@ echo "${userjson}" | jq . >"${customer_dir}/users.json" status=${?} if [[ ${status} -eq 0 ]]; then # something is wrong if we cant copy the file in 30 seconds, so we should note that - if ! timeout 30s rclone copy --no-check-certificate --webdav-headers "Host,sunet.drive.sunet.se" --use-cookies "${customer_dir}/users.json" "${base_dir}/${location}/"; then + if ! timeout 30s rclone copy -c --no-check-certificate --webdav-headers "Host,sunet.drive.sunet.se" --use-cookies "${customer_dir}/users.json" "${base_dir}/${location}/"; then status=1 fi fi diff --git a/templates/script/usage.erb.sh b/templates/script/usage.erb.sh index 9f2c0c2..89583b0 100644 --- a/templates/script/usage.erb.sh +++ b/templates/script/usage.erb.sh @@ -59,11 +59,11 @@ rclone mkdir "${location}:drive-${location}-share" echo -n "${result1}" >"${outfile1}" echo -n "${result2}" >"${outfile2}" -rclone copyto --no-check-certificate --webdav-headers "Host,sunet.drive.sunet.se" --use-cookies "${outfile1}" "statistics:drive-storage-report/${customer}-usage/daily/${outfile1}" -rclone copyto --no-check-certificate --webdav-headers "Host,sunet.drive.sunet.se" --use-cookies "${outfile2}" "statistics:drive-storage-report/${customer}-usage/daily/${outfile2}" +rclone copyto -c --no-check-certificate --webdav-headers "Host,sunet.drive.sunet.se" --use-cookies "${outfile1}" "statistics:drive-storage-report/${customer}-usage/daily/${outfile1}" +rclone copyto -c --no-check-certificate --webdav-headers "Host,sunet.drive.sunet.se" --use-cookies "${outfile2}" "statistics:drive-storage-report/${customer}-usage/daily/${outfile2}" -rclone copyto --no-check-certificate --webdav-headers "Host,sunet.drive.sunet.se" --use-cookies "${outfile1}" "statistics:drive-storage-report/${customer}-usage/${customer}-latest-detailed.csv" -rclone copyto --no-check-certificate --webdav-headers "Host,sunet.drive.sunet.se" --use-cookies "${outfile2}" "statistics:drive-storage-report/${customer}-usage/${customer}-latest.csv" +rclone copyto -c --no-check-certificate --webdav-headers "Host,sunet.drive.sunet.se" --use-cookies "${outfile1}" "statistics:drive-storage-report/${customer}-usage/${customer}-latest-detailed.csv" +rclone copyto -c --no-check-certificate --webdav-headers "Host,sunet.drive.sunet.se" --use-cookies "${outfile2}" "statistics:drive-storage-report/${customer}-usage/${customer}-latest.csv" rm "${outfile1}" rm "${outfile2}"