The Script
Create a file calledbackup.sh:
nano backup.sh
Paste the following code:
How to Use It
- Save and Close: Press
CTRL+O,Enter, thenCTRL+X. - Make the script executable:
chmod +x backup.sh - Run it manually:
./backup.sh
Automating with Cron (Scheduling)
You can have this script run automatically every day (e.g., at 4:00 AM).-
Open crontab:
crontab -e -
Add this line to the end of the file:
0 4 * * * /path/to/your/backup.sh(Make sure to use the full path, e.g.,/home/user/backup.sh) - Save and close.
Guide created by HighMark - All information and contacts on my official website: Highmark.it

