SRE-Docker Compose for CRON job

0 votes

We had a task to Create a docker file with ubuntu image

  1. Create a print.sh file which has code to print date and time
  2. Write acron file named "hello-cron" which includes the print.sh to run for every 1 min.
  3. The docker image should have a CRON job to print date and time every 1 min

We created a print.sh file via vi / vim command and in it given as

#!/bin/sh -l
time=$(date)
echo "::set-output name=time::$time"

After which we had executed -

chmod +x print.sh

then tried as -

* * * * * /home/scrapbook/tutorial

Getting error as -

$ * * * * * /home/scrapbook/tutorial
bash: print.sh: command not found

Not sure where we went wrong, please guide us.

Feb 15, 2021 in Docker by anonymous

edited Mar 4, 2025 313 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP