CD2 DAP - scheduling syncdb with cron

Jump to solution
morris_gart
Community Explorer

I have everything working as I would like.  Postgres has all the schema and tables and I can successfully run the syncdb on all the tables in Terminal (I am on a mac).  I would like to schedule the syncdb with cron but I have hit a wall.  Right now the error is that dap is not available or found.  Anyone sucessfully using cron to automate the syncdb?

Labels (3)
0 Likes
1 Solution
reynlds
Community Contributor

No problems here (outside of the occasional DAP service issue). Been running a CRON job for years on this. I wrap the DAP client in a Bash script (linux). Here is the latest iteration of this process allowing you to do everything through arguments:  https://github.com/reynlds-illinois/enterprise_learning_systems/blob/main/canvas_data_2/cd2.sh

Adding the "-l" switch on the shebang line helps!

Here is the line in crontab for performing a sync with error-level logging. It kicks off every 6 hours 6 days a week:

05 00,06,12,18 * * 0-5 /var/lib/canvas-mgmt/bin/cd2.sh syncdb error

 

View solution in original post

0 Likes