Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add cron job to restart the service every few days #67

Merged
merged 2 commits into from
Oct 12, 2023
Merged

Conversation

akhileshthite
Copy link
Collaborator

@akhileshthite akhileshthite commented Oct 10, 2023

hyphacoop/distributed-press-organizing#95

Added cron job to restart api.distributed.press service every 3 days

sudo ansible-playbook distributed_press.yml -i local_deploy.yml --tags cron

Screenshot 2023-10-10 at 11 39 03 PM

sudo crontab -l

Screenshot 2023-10-10 at 11 39 40 PM

@akhileshthite akhileshthite self-assigned this Oct 10, 2023
@akhileshthite
Copy link
Collaborator Author

akhileshthite commented Oct 10, 2023

hyphacoop/distributed-press-organizing#95

sudo ansible-playbook distributed_press.yml -i local_deploy.yml --tags cron

Screenshot 2023-10-10 at 11 39 03 PM

sudo crontab -l

Screenshot 2023-10-10 at 11 39 40 PM

@RangerMauve
I don't have a linux machine to test with the systemctl command.
However, I adjusted the cron timing every minute for quicker testing to ensure the systemctl command works as expected.

Can you test this?

- name: "Test cron job to restart api.distributed.press service every minute"
  cron:
    name: "Restart api.distributed.press service"
    minute: "*"
    job: "/bin/systemctl restart {{ distributed_press_service_name }}"
  become: yes
  tags:
    - cron
sudo ansible-playbook distributed_press.yml -i local_deploy.yml --tags cron

Copy link
Contributor

@RangerMauve RangerMauve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and it works. Mind checking if the template is still needed and removing it if not?

@RangerMauve RangerMauve merged commit c0c9f37 into main Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants