clmbmb

joined 2 years ago
[–] clmbmb -1 points 1 year ago (2 children)

You have no idea what that would do in Linux. First read some documentation, then decide if you really need it. I guess you can see by the number of people trying to put you on the right path that what you want is not a good idea.

[–] clmbmb 8 points 1 year ago

Sync has got a flurry of updates on the last two weeks, so it's not discontinued.

[–] clmbmb 2 points 1 year ago

I wasn't talking about myself. I was talking from the perspective is an average person.

[–] clmbmb -1 points 1 year ago (1 children)

Are you the CEO?

[–] clmbmb 11 points 1 year ago (2 children)

That doesn't mean it's not paywalled. Just that you have the knowledge and the means to climb over that wall. Not all people have.

[–] clmbmb 2 points 1 year ago

Yes, for sure. Timers are more versatile than what cron jobs can do.

[–] clmbmb 3 points 1 year ago (1 children)

I can't see anywhere that a [Timer] section can be added to a service unit. I tried it and it doesn't work:

Apr 11 13:16:15 computer systemd[2593025]: /home/clmbmb/.config/systemd/user/test.service:10: Unknown section 'Timer'. Ignoring.

The service/script ran as it should, but the Timer section is ignored, as you can see.

[–] clmbmb 1 points 1 year ago

Thanks for the suggestion. I'll look into this too.

[–] clmbmb 7 points 1 year ago (2 children)

I don't think so, but I wanted to try systemd timers.

[–] clmbmb 5 points 1 year ago

I just read a bit some internet posts and the documentation. I set TimeoutSec=infinity inside the service and I set the timer to run it now. I'll see if that helps.

[–] clmbmb 4 points 1 year ago

Just in case, you are sure that you didn’t just accidentially kill or killall rclone or bash?

No. The process runs at night. Only if my dog started learning Linux and tested something! That makes me wonder...

[–] clmbmb 5 points 1 year ago (2 children)

No, my script doesn't fork and I don't think rclone does that either.

Here's the script (pretty simple):

#!/bin/bash

repos=(fotorepo multirepo persorepo appconfigs)

if pidof -x rclone >/dev/null; then
  echo "Process already running"
  exit 1
fi

for repo in "${repos[@]}"; do
    inidate=$(date +'%Y%m%d_%H%M%S')
    /usr/bin/rclone -v --log-file=/backup/borg/logs/${repo}_b2sync_${inidate}.log sync /backup/borg/${repo} b2:${repo}
    if [[ $? -eq 0 ]]; then
      MSGDATE=$(date +'%d/%m/%y %T')
      mesaj="[${MSGDATE}] Upload for ${repo} was successful."
      curl -H "Title: B2 Upload" -H "Tags: arrow_double_up" -d "${mesaj}" "${URL}"
      #sendmsg "[${MSGDATE}] Upload for <b>${repo}</b> was <b><u>successful</u></b>."
    else
      MSGDATE=$(date +'%d/%m/%y %T')
      mesaj="[${MSGDATE}] Upload for ${repo} has failed. Check the logs."
      curl -H "Title: B2 Upload" -H "Tags: warning" -H "prio:high" -d "${mesaj}" "${URL}"
      #sendmsg "[${MSGDATE}] Upload for <b>${repo}</b> has <b><u>failed</u></b>. Check the logs."
    fi
    enddate=$(date +'%Y%m%d_%H%M%S')
    mv /backup/borg/logs/${repo}_b2sync_${inidate}.log /backup/borg/logs/${repo}_b2sync_${enddate}.log
done
view more: ‹ prev next ›