I want to run a 4 commands before a hibernate and another 2 commands after update. Is it also possible to arrange the time/squence of each commands,if yes then could you explain how?
Hibernate – How to Run a Script Before or After
hibernatescripts
hibernatescripts
I want to run a 4 commands before a hibernate and another 2 commands after update. Is it also possible to arrange the time/squence of each commands,if yes then could you explain how?
Best Answer
You can run commands before and after hibernation or suspension (note there is a difference; hibernation is to disk, suspension is to memory) by creating a script in
/etc/pm/sleep.d
:The filename of the script will dictate the order in which the scripts run compared to other scripts in sleep.d. Within your script, your commands will run in whatever order you put then in the script.