Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1423  / 2 Years ago, thu, october 13, 2022, 12:43:39

I create machine VM with terraform, I have 3 job that should be create into crontab file when server creation.
These 3 jobs must be run automatically inside crontab file.


How can I do that?


More From » cron

 Answers
1

In project I created a script.sh file for my corns that I wanted to run when Terraform provisioning machine, then I put that on remote-exec.


The script.sh contains below code for one crone, for more crones we need another one.


lines2="*/1 * * * * /bin/bash path/to/file/on/machine_mgmt.sh >> path/to/file/on/machine-log.txt" ( crontab -u root -l; echo "$lines2" ) | crontab -u root -


[#2289] Friday, October 14, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tocklftime

Total Points: 110
Total Questions: 109
Total Answers: 100

Location: Mayotte
Member since Mon, Sep 12, 2022
2 Years ago
tocklftime questions
;