Though it's working, I am curious if those work on cron
why which aws this is not working, I mean what I am missing?
aws is on /usr/local/bin/aws
It's because CRON Jobs(crontab) runs in different environment than the user. So the CRON doesn't know where users applications are installed(like aws, mysql, gzip etc.)
But CRON by default includes some paths and ENV variables like $HOME , /usr/bin and some others.(Quick google search will tell you everything CRON includes...)
So this way CRON recognizes mysql, mysqldump as they are installed on /usr/bin/. But it doesn't include aws as it's installed in /usr/local/bin/aws/ so you should manually specify it.
I know this is little complicated, even I had similar problem when I was working with whenever gem.
Yeah, it's complicated but you explain well thanks a lot.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.