Advertisement
71GA

Untitled

Jun 20th, 2016
496
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.00 KB | None | 0 0
  1. [ziga@ziga-laptop ~]$ systemctl status cronie.service
  2. ● cronie.service - Periodic Command Scheduler
  3.    Loaded: loaded (/usr/lib/systemd/system/cronie.service; enabled; vendor preset: disabled)
  4.    Active: active (running) since Tue 2016-06-21 00:10:48 CEST; 24min ago
  5.  Main PID: 421 (crond)
  6.     Tasks: 1 (limit: 512)
  7.    CGroup: /system.slice/cronie.service
  8.            └─421 /usr/bin/crond -n
  9.  
  10. Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
  11. [ziga@ziga-laptop ~]$ crontab -l
  12. */1 * * * * /home/ziga/Dropbox/workspace/operacijski/archlinux/hibernate/cronie-hibernate
  13. [ziga@ziga-laptop ~]$ cat /home/ziga/Dropbox/workspace/operacijski/archlinux/hibernate/hibernatescript
  14. #!/bin/sh
  15. acpi -b | awk -F'[,:%]' '{print $2, $3}' | {
  16.         read -r status capacity
  17.  
  18.         if [ "$status" = Discharging -a "$capacity" -lt 13 ]; then
  19.                 logger "Critical battery threshold"
  20.                 systemctl hibernate
  21.         fi
  22. }
  23. [ziga@ziga-laptop ~]$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement