Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

/home/bahmni/endtb_export

NOTE: The export can be run at any time by following these steps: 

  1. Login to the server system and open terminal. 
  2. Change the user to 'bahmni' by typing in the following command :"sudo su bahmni". This must change your user to bahmni. 

  3. Now execute the command '/usr/bin/bahmni-batch'

  4. The system should show "Running bahmni-batch..."
  5. When the export is generated the system would give a message "Done"
  6. Now the export can be accessed at the file location mentioned above 

Scheduling the background job:

...

  1. Open the terminal and change the user to "bahmni" by executing the command "sudo su bahmni"

  2. Now type the following command "crontab -l"

  3. You would see a list of all the cron jobs (background jobs) in the system for the user "bahmni"

  4. You would see the line "30 23 * * * /usr/bin/bahmni-batch >/dev/null 2>&1" shown as the output when you run the above command. This is because we have provided a schedule to the background job by default. This schedule would run the job everyday at 11:30PM 
  5. To change this schedule or to add a new schedule you would need the help of a cron generator. This can be accessed at: http://crontab-generator.org/
    Image Added
  6. After selecting the schedule, (for example in the above image the schedule that I would want to generate for my job is every 30 minutes.) you will see a field below labeled "Command to execute". Enter the following in this field and click on "Generate Crontab Line". Image Added
  7. After clicking the button you will see that your crontab expression is generated and shown at the top of the page. 
    Image Added
  8. Now you should copy this expression and go to the terminal again. Execute the command "crontab -e"
  9. You would be seeing the file that lists all the schedules for different cron jobs. If you have not saved any, you would only see one line in the file which would represent the schedule that has been set for the jobs by default. (11:30PM every day) Image Added
  10. Insert the line into this file and save it. (insert and save will work as per your editor). This should set the schedule for the background job. 

 

Accessing the error log:

  1. The error log for the background job can be accessed at "/var/log/bahmni-batch"
  2. In this directory there would be a file that would have the log.