Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rehankarthikchandralal/bash-script-for-automated-file-backup
A Bash script is created which runs every day and automatically backs up any encrypted password files that have been updated in the past 24 hours.
https://github.com/rehankarthikchandralal/bash-script-for-automated-file-backup
bash linux
Last synced: 24 days ago
JSON representation
A Bash script is created which runs every day and automatically backs up any encrypted password files that have been updated in the past 24 hours.
- Host: GitHub
- URL: https://github.com/rehankarthikchandralal/bash-script-for-automated-file-backup
- Owner: rehankarthikchandralal
- Created: 2024-11-02T20:15:28.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2024-11-27T14:34:31.000Z (about 1 month ago)
- Last Synced: 2024-11-27T15:34:12.630Z (about 1 month ago)
- Topics: bash, linux
- Language: Shell
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bash-Script-for-Automated-File-Backup
This project provides a **Bash script** that automatically backs up encrypted password files updated in the past 24 hours. The script creates a compressed archive of the files and stores it in a specified destination directory.
## Script Overview
The backup script:
- Takes two arguments: the target directory (where encrypted password files are located) and the destination directory (where backups will be saved).
- Checks if both directories are valid. If not, it displays an error message and exits.
- Identifies files in the target directory that have been modified within the last 24 hours.
- Compresses these files into a `.tar.gz` backup archive with a unique timestamp.
- Moves the backup file to the specified destination directory.## Script Details
### Important Variables
- **`targetDirectory`**: The directory containing files to back up.
- **`destinationDirectory`**: The directory where the backup archive will be saved.
- **`currentTS`**: The current timestamp in seconds.
- **`backupFileName`**: The name of the backup file with a timestamp for uniqueness.