Scheduling a capistrano function using cron
I am a php developer using capistrano with multi-stage support to deploy my application to my production servers. Hence, I have very little knowledge about rubies or rails.
I've figured out enough to add a new function called flush to my deploy.rb script that calls the PHP script on all of my production servers. The purpose of the "flash" is to connect to each production server and execute a PHP script that writes all the logs from each server's local mysql tables to my master db.
I'm sure this function works from the moment it is executed from the command line (cap prod flush) and gives accurate results.
I would like to schedule a cron job that calls this function every hour. First, I wrote a bash script that does this function:
!#/bin/bash
`/usr/bin/cap prod flush`
However, when the cron job runs the script, it gives me the following error:
the "prod" task does not exist
I believe the problem is when cron is running and not executing the script in the appropriate directory. I tried changing the $ PATH and $ HOME variable in bash scripts, but I can't seem to get it to work.
Can anyone suggest me some help?
Thank!