My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
ExampleCronJob  
Example cron job used to sync with other servers in the network
cron
Updated Feb 4, 2010 by shantibr...@gmail.com

Example Cron Job

The following cron job assumes that:

  • App RAILS_ROOT: /u/apps/hydra/current
  • App environment: production
  • Sync users/torrents every 5 minutes
  • Sync transfer stats daily @ 1am

The cron job:

# Sync Users and Torrents Every 5 Minutes
0-59/5 * * * * RAILS_ENV=production /usr/bin/ruby /u/apps/hydra/current/script/runner -e production 'Sync.sync_every_five' > /dev/null 

# General Daily Cron - Sync transfer stats @ 1am
0 1 * * * RAILS_ENV=production /usr/bin/ruby /u/apps/hydra/current/script/runner -e production 'Sync.sync_daily' > /dev/null 

See Here for a crontab tutorial.

Normally the workflow is just:

crontab -e
# Opens up your default text editor -- paste in your cron jobs
# Save the file and exit, and your new cron jobs should now be installed

# View your cron list with:
crontab -l
Powered by Google Project Hosting