-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.sh
More file actions
36 lines (31 loc) · 1.42 KB
/
script.sh
File metadata and controls
36 lines (31 loc) · 1.42 KB
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
27
28
29
30
31
32
33
34
35
36
# Fetching supplier data
sudo chmod +x ~/download_drive_file.sh
./download_drive_file.sh 1LePo57dJcgzoK4uiI_48S01Etck7w_5f supplier-data.tar.gz
tar xf ~/supplier-data.tar.gz
# Working with supplier images
nano ~/changeImage.py # script to process the supplier images
sudo chmod +x ~/changeImage.py
./changeImage.py
file ~/supplier-data/images/003.jpeg # check image specifications
# Uploading images to web server
nano ~/supplier_image_upload.py # complete the script with the same technique as used in the file example_upload.py
sudo chmod +x ~/supplier_image_upload.py
./supplier_image_upload.py
# Uploading the descriptions
nano ~/run.py # write a python script named run.py to process the text files
sudo chmod +x ~/run.py
./run.py
# Generate a PDF report and send it through email
nano ~/reports.py # ceate a script reports.py to generate PDF report to supplie
nano ~/emails.py
nano ~/report_email.py
sudo chmod +x ~/report_email.py
./report_email.py
# Health check
nano ~/health_check.py # write a Python script that will run in the background monitoring some of your system statistics
sudo chmod +x ~/health_check.py
./health_check.py
sudo apt install stress # install the stress tool to test script
stress --cpu 8 # call the tool using a good number of CPUs to fully load our CPU resources
./health_check.py
crontab -e # setting a cron job that executes the script health_check.py every 60 seconds and sends health status to the respective user