mirror of
https://github.com/wickedyoda/public-setupfiles.git
synced 2026-11-16 13:31:56 -06:00
Python dir
Made python dir
This commit is contained in:
1 parent
f46d15d86b
commit
bf341ea8c6
2 files changed
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import subprocess
|
||||
|
||||
# Run 'sudo apt update'
|
||||
subprocess.run(['sudo', 'apt', 'update'])
|
||||
|
||||
# Run 'sudo apt install cron cron-apt -y'
|
||||
subprocess.run(['sudo', 'apt', 'install', 'cron', 'cron-apt', '-y'])
|
||||
|
||||
# Run 'sudo systemctl enable cron'
|
||||
subprocess.run(['sudo', 'systemctl', 'enable', 'cron'])
|
||||
|
||||
# Run 'sudo systemctl stop cron'
|
||||
subprocess.run(['sudo', 'systemctl', 'stop', 'cron'])
|
||||
|
||||
# Append the cron job to /etc/crontab
|
||||
cron_job = 'echo "MAILTO=\"alerts@tyates.one\"\n0 */6 * * * root apt-get update && apt-get -y -d full-upgrade && apt-get autoremove -y && sudo apt-get clean -y && sudo apt-get purge -y" >> /etc/crontab'
|
||||
subprocess.run(cron_job, shell=True)
|
||||
|
||||
# Run 'sudo systemctl start cron'
|
||||
subprocess.run(['sudo', 'systemctl', 'start', 'cron'])
|
||||
@@ -0,0 +1,19 @@
|
||||
import subprocess
|
||||
|
||||
# Run 'sudo apt update'
|
||||
subprocess.run(['sudo', 'apt', 'update'])
|
||||
|
||||
# Run 'sudo apt full-upgrade -y'
|
||||
subprocess.run(['sudo', 'apt', 'full-upgrade', '-y'])
|
||||
|
||||
# Run 'sudo apt dist-upgrade -y'
|
||||
subprocess.run(['sudo', 'apt', 'dist-upgrade', '-y'])
|
||||
|
||||
# Run 'sudo apt autoremove -y'
|
||||
subprocess.run(['sudo', 'apt', 'autoremove', '-y'])
|
||||
|
||||
# Run 'sudo apt clean -y'
|
||||
subprocess.run(['sudo', 'apt', 'clean', '-y'])
|
||||
|
||||
# Run 'sudo apt purge -y'
|
||||
subprocess.run(['sudo', 'apt', 'purge', '-y'])
|
||||
Reference in new issue
Block a user