add basic crontabs to be added for base user and root

This commit is contained in:
JesseBot 2024-10-20 23:21:46 +02:00
parent d81624fcfa
commit 403c712eb6
No known key found for this signature in database
8 changed files with 59 additions and 0 deletions

45
.config/cron/README.md Normal file
View file

@ -0,0 +1,45 @@
# file structure
```
 .
├──  README.md
├── 󰉐 root
└──  user
```
## root (super user) cron jobs
```
 .
├──  README.md
└── 󰉐 root
├──  crontab
└──  daily.sh
```
Anything in `root/daily.sh` gets run by `root` every day.
- Currently, this just runs `apt-get update/upgrade` as root to avoid sudo passwords.
`root/crontab` is the file that is copied into `/var/at/tabs` on macOS and `/etc/crontab.d/` on Linux.
## User cron jobs
```
 .
└──  user
├──  crontab
├──  daily.sh
├──  go_home.sh
├──  lunch.sh
└──  self_care_time.sh
```
The "user" is the user that ran last ran `onboardme`. All scripts below will run as that user.
`user/lunch.sh` gets run at lunch time (noon) by the user, for reminders.
`user/daily.sh` gets run daily by the user right after lunch reminders.
- Currently, this runs `onboardme` for updating dot files, OS packages (brew, pip3.12, pipx), fonts, and neovim packages.
`user/go_home.sh` gets run at at 17:10 to remind the user to go home.
`user/self_care_time.sh` gets run at at 22:30 to remind the user to do self care tasks.
`user/crontab` is the file that is copied into `/var/at/tabs` on macOS and `/etc/crontab.d/` on Linux.

View file

@ -0,0 +1 @@
0 12 * * * ~/.config/cron/daily_root.sh

View file

@ -0,0 +1,5 @@
echo "apt upgrades start at:"
date
time apt-get update && time apt-get upgrade -y
echo "apt upgrades complete at:"
date

View file

@ -0,0 +1,4 @@
0 12 * * * ~/.config/cron/lunch.sh
30 12 * * * ~/.config/cron/daily.sh
10 17 * * * ~/.config/cron/go_home.sh
30 20 * * * ~/.config/cron/self_care_time.sh

View file

@ -0,0 +1 @@
onboardme -s dot_files -s packages -s font_setup -s neovim_setup -p brew -p pipx -p pip3.12 -g default -g default

View file

@ -0,0 +1 @@
say "Time to wrap up and go shopping for dinner!"

View file

@ -0,0 +1 @@
say "Perhaps it's time for a bit of a break. Maybe get a snack."

View file

@ -0,0 +1 @@
say "time to do a self care task. You can brush your teath, do your facial care routine, tend to your hands and feet, and change into jammies."