-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathsysStartupNotify.py
More file actions
26 lines (21 loc) · 992 Bytes
/
Copy pathsysStartupNotify.py
File metadata and controls
26 lines (21 loc) · 992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""
Author: Rajesh Thennan
Source: https://github.com/rthennan/ZerodhaWebsocket
Send an email stating the machine has started.
Added as a cronjob to run on startup: @reboot /usr/bin/python3 /home/ubuntu/ZerodhaWebsocket/sysStartupNotify.py
"""
from datetime import datetime as dt
import sys
from os import path
#Expects DAS_gmailer and tradeHolidayCheck to be in the same path
# Get the absolute path of the current file
scriptAbsolutePath = path.abspath(__file__)
#Get Directory
# Get the directory of the current script
scriptDirectory = path.dirname(scriptAbsolutePath)
# Append the script directory to the system path
if scriptDirectory not in sys.path:
sys.path.append(scriptDirectory)
# Allows importing DAS_gmailer irrespective of where traceHolCheck is called from
from DAS_gmailer import DAS_mailer
DAS_mailer('DAS - Machine started Successfully',f'DAS - Machine started Successfully Successfully at {str(dt.now().replace(microsecond=0))}')