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

[Issue] : cron job not running as expected after CodeDeploy changes the code in EC2 using CodePipeline #392

Open
zaladevdeep opened this issue Mar 21, 2024 · 0 comments

Comments

@zaladevdeep
Copy link

Here is my root crontab file contents:

@reboot sudo systemctl start codedeploy-agent
43 14 * * * cd /home/ec2-user/DeltaNeutral_Live && source ./delta/bin/activate && python3 001automate_token_fyers.py && python3 fyers_test.py >> /home/ec2-user/DeltaNeutral_Live/cron.log 2>&1
10 10 * * * pkill -f "python3 fyers_test.py" 

Crontab commands does not run as expected.
Also i have made a Code Pipeline where Code Deploy is connected. As soon as i commit the code, source takes the latest commit and passes to Code Deploy, Also the files in EC2 changes as per the latest commit. But cron job does not do its job as mentioned.
Also if i manually use the command in command prompt, then logging in as ec2-user which is default for aws linux, the command runs as expected. But the same does not runs as expected in cron job.

Please help me with this issue.

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

No branches or pull requests

1 participant