Ubuntu My Notes
By Pravin•
on Startup
sudo apt update -y sudo apt upgrade -y
Timezone
timedatectl
change timezone
sudo timedatectl set-timezone Asia/Kolkata
services
sudo service cron status sudo service cron start sudo service cron stop sudo service cron restart sudo service cron reload `` or you can use ```sh sudo systemctl status cron sudo systemctl start cron sudo systemctl stop cron sudo systemctl reload cron sudo systemctl restart cron
If any script is working fine when you run it but getting error-ed out when run from crontab. Use below command to get the errror
env -i /usr/bin/python /path/to/your/script.py
find a file from terminal
find . -name "my_script.log"
change ownership
# 1. Fix .env file sudo chown ubuntu:ubuntu .env # 2. Fix logs directory (most important) sudo chown -R ubuntu:ubuntu logs/ # 3. Fix everything in the project (safest one-liner) sudo chown -R ubuntu:ubuntu .
To logged in user
# Fix the logs directory sudo chown -R $USER:$USER .env # Fix the logs directory sudo chown -R $USER:$USER logs/ # Fix the whole project (safest) sudo chown -R $USER:$USER .
Comments
No comments yet. Be the first to comment!
Leave a Comment
Your comment will be visible after approval.