相关文章推荐
腼腆的滑板  ·  Python List sort()方法 ...·  1 年前    · 
有情有义的蟠桃  ·  base1. ...·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I have a systemctl job that performs vertica backup to s3, i wanted to add a timer that runs everyday at 3am . I tried to create an override file with the timer section but when i do daemon-reload, I am getting an error `Unknown section Timer', I am unable to find the issue.

/etc/systemd/system/vertica-backup.service.d/Override.conf

[Timer]
OnCalendar=*-*-* 03:00:00
Unit=vertica-backup.service

/etc/systemd/system/vertica-backup.service:

[Unit]
Description = Vertica Backup Service
After = network.target
[Service]
User= dbadmin
ExecStart= /usr/local/bin/vertica-backup.sh

Error

May 15 15:19:47 ip-10-150-4-42.ec2.internal systemd[1]: [/etc/systemd/system/vertica-backup.service.d/override.conf:1] Unknown section 'Timer'. Ignoring.
May 15 15:19:50 ip-10-150-4-42.ec2.internal systemd[1]: [/etc/systemd/system/vertica-backup.service.d/override.conf:1] Unknown section 'Timer'. Ignoring.

[Timer] sections don't go in service files, they go in their own .timer files. Create /etc/systemd/system/vertica-backup.timer and put the [Timer] section in there.

See man systemd.timer for reference.

And do I have to just start and run the timer always that triggers the service OR do I also have to run the service always? – sqp_125 Feb 22, 2022 at 5:39

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.