Get the App
SLTechnology News&Howtos  ›  Database  › 

Special flip-flop through shell timing switch

Shulou Source: shulou.com Published: 2022-06-01 09:30:18 10月01日 Update

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.

Tags: Scripts triggers jobs tasks functions exotic practical information spirit systems problems needs help special Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Shulou Technology Xiaomi Huawei Shulou Information