Score:0

To have a cronjob triggered both daily and upon reboot, do I need two separate jobs?

my flag

I have a line in the cronfile like this.

@daily cd Model_Pipeline && bash deploy.sh>>deployment.log 2>&1

It is running everyday just fine, but I also want it to run upon every reboot as well. Do I have to add another line, or is there a way to add an OR clause to the existing line (which seems a cleaner method)?

Also, I am not a root user. Does it hinder running the job at reboot?

ar flag
Of the top of my head yes, you will need 2 lines. Look at the command `anacron`. This may do what you want.
cn flag
adding @reboot will have it run twice when you start your machine.
Score:1
vn flag

You simply have to add a second line with the @reboot trigger.

@reboot cd Model_Pipeline && bash deploy.sh>>deployment.log 2>&1

And it's perfectly fine to run cronjobs @reboot with your normal user.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.