Advertisement
metalx1000

daily manning email for callback staffing

Aug 31st, 2015
807
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.90 KB | None | 1 0
  1. #!/bin/bash
  2. #Copyleft 2015 Kris Occhipinti http://filmsbykris.com
  3. #Released under GNU AGPLv3 - http://www.gnu.org/licenses/agpl-3.0.txt
  4. #This script pulls the daily staffing PDF from the Callback Staffing website
  5. #and emails it to set address
  6. #Please fill in 'username', 'password', and 'mailto'
  7. #Use a cron job to set daily
  8.  
  9. username="<user>"
  10. password="<password>"
  11. mailto="<email>"
  12. subject="GNFD Manning $(date)"
  13. msg="Greater Naples"
  14. baseurl="https://www.callbackstaffing.com/Application"
  15. date=$(date --date="$(date +'%m/%d/%Y')" +%s)
  16. output="$HOME/tmp/staffing.pdf"
  17. cookie="$HOME/tmp/cookie"
  18.  
  19. #login and download PDF
  20. curl -c "$cookie" "$baseurl/Login/process" -d "username=$username&password=$password"
  21. curl -b "$cookie" "$baseurl/UserPanel/Schedule/ExportDay/?start=$date" -o "$output"
  22.  
  23. #send mail
  24. echo "$msg" | mailx -a "$output" -s "$subject" -- $mailto
  25.  
  26. #cleanup
  27. rm "$output" "$cookie"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement