Posted Tuesday at 09:48 AM3 days Write a BASH script that performs a backup of a specified directory to a target location. The script should include the following functionality: Basic Requirements: Accept two arguments: Source directory Target backup location Verify that both the source and target locations exist. Create a timestamped backup folder in the target location. Log the backup process, including the time taken and the number of files backed up. Bonus Features: Implement compression (e.g., using tar or zip) for the backup. Add error handling to catch issues like missing arguments or permission errors. Allow for incremental backups by only copying new or modified files. Example Usage: ./backup.sh /home/user/documents /mnt/backup Example Output: Backup started at: 2025-01-06 10:35:21 Backing up /home/user/documents to /mnt/backup/backup_20250106 Number of files backed up: 124 Backup completed in: 2 minutes CodeName: Jessica 💻 Linux Enthusiast | 🌍 Adventurer | 🦄 Unicorn 🌐 My Site | 📢 Join the Forum
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now