Sync Local Directory to Remote Server with rsync
Automate efficient and incremental file synchronization from your local machine to a remote web server using rsync over SSH, perfect for deployments.
Curated list of production-ready BASH scripts and coding solutions.
Automate efficient and incremental file synchronization from your local machine to a remote web server using rsync over SSH, perfect for deployments.
Quickly analyze Nginx access logs to identify and count specific HTTP error codes (e.g., 4xx, 5xx) using `grep`, `awk`, and `sort` for web server monitoring.
Create a robust bash script to automate daily MySQL database backups, compressing them with a timestamp for easy recovery and storage management.
Create a bash script to periodically check the status of a critical systemd service (e.g., Nginx, PHP-FPM) and automatically restart it if it's found to be inactive.
Learn to build robust bash scripts that accept and parse command-line arguments using `getopts`, enabling flexible execution with options and values.
Learn to process web server access logs using `grep` and `awk` to extract common errors, unique IP addresses, and request statistics for debugging.
Automate checking if a critical Linux service (e.g., Nginx, a Node.js process) is running and restart it if it's found to be inactive, ensuring application uptime.
Create a Bash script to set up common environment variables and useful command aliases for all new shell sessions, enhancing developer productivity and consistency.
Learn to implement robust error handling, trap signals, and redirect all script output to a log file, ensuring critical operations are reliably monitored and debugged.
Learn to efficiently parse short command-line options and their arguments using `getopts` in Bash, making your scripts more flexible and user-friendly.
Discover how to use Bash to check if a specific network port is in use and identify the process (PID and name) currently listening on it, useful for debugging port conflicts.
Implement a Bash script to monitor disk space usage on your server and send an email alert when a specified threshold is exceeded, preventing critical storage issues.