Prompt Title: Bash Script Requested.

Created 1 year ago
Votes 0
Views 312 times
0

Prompt Detail:

Sure, here is a Bash script that should accomplish what you are looking for:

bash
#!/bin/bash # Get the current date in the format DDMMYY DATE=$(date +"%d%m%y") # Specify the path to the directory you want to back up BACKUP_PATH="/path/to/backup" # Create the backup file with the current date in the name tar -cvf Backup$DATE.tar $BACKUP_PATH # Compress the backup file gzip Backup$DATE.tar

You will need to replace the /path/to/backup with the actual path to the directory you want to back up. You can also adjust the naming scheme if you prefer a different format.

To run the script, save it to a file (e.g. backup.sh), make it executable using the command chmod +x backup.sh, and then run it using the command ./backup.sh.

avatar
Christoph
Shared 1 prompt
Created 1 year ago

Leave a Comment

Related Tag Prompts

0
0
Backup files to remote server.
1 year ago 2023-03-03 06:44:33
0
0
Bashのhistory機能
1 year ago 2023-04-01 22:21:22 bash