Special flip-flop through shell timing switch
The work encountered this strange demand temporarily, so I wrote a shell script to implement this function. In the spirit of open source sharing, we will share practical information with you. I hope I can help you solve this problem in your work.
1. Two scripts need to be set up to turn on and off triggers respectively.
# # this is the shutdown script #! / bin/bashsource / home/oracle/.profilePWD_SYS= "/" sqlplus yxtx$ {PWD_SYS} 123456 # # this is the open shell script #! / bin/bashsource / home/oracle/.profilePWD_SYS= "/" sqlplus yxtx$ {PWD_SYS} 123456
2. Set up linux system to plan tasks
50 23 * / home/oracle/jiankong_close.sh > / home/oracle/jiankong_close.log 2 > & 1
* 7 * / home/oracle/jiankong_open.sh > / home/oracle/jiankong_open.log 2 > & 1
In this way, the trigger can be automatically turned on at 7 o'clock every morning and closed automatically at 11:50 every night.