Compare commits

..

No commits in common. "main" and "folderarchive-v1.1" have entirely different histories.

3 changed files with 6 additions and 40 deletions

View File

@ -1,10 +1,5 @@
# Folder2Archive # Folder archive
<img align="right" width="150" src="https://git.moelle.space/hxcde/folder2archive/raw/branch/main/f2a.png"> > Daily Folder Backup and Rotation for Linux
<br>
> Daily Folder Backup and Rotation for Linux <br>
> I use this to create archives of my website every day
## Key Features: ## Key Features:
- Daily automated backups of a specified folder using the zip utility. - Daily automated backups of a specified folder using the zip utility.
@ -23,41 +18,14 @@
Paste the script in your machines console. Paste the script in your machines console.
```bash ```bash
sh -c "$(curl -L http://script.moelle.space/folder2archive)" sh -c "$(curl -L http://script.moelle.space/folderarchive)"
``` ```
## Settings
<details>
<summary>Change the day count </summary>
<br>
Edit the file zip_folder_daily.sh `(If you used automatic install it's in /opt)` and change the day number in line 16.
<br> If you want 30 days, it's `30 minus 1`, so `29`
```bash
find "${ARCHIVE_DIR}" -name "folder_*.zip" -mtime +13 -exec rm {} \;
```
Example: Chamge the `13` to `29`
```bash
find "${ARCHIVE_DIR}" -name "folder_*.zip" -mtime +29 -exec rm {} \;
```
</details>
<details>
<summary>Change the schedule </summary>
<br>
Edit the cronjob with `crontab -e`
```bash
0 13 * * * sh /path/to/script/zip_folder_daily.sh
```
If you need help to configure the crontab, check this site https://crontab.guru/
</details>
## Manual installation ## Manual installation
<details> <details>
<summary>Installation </summary> <summary>expand </summary>
<br> <br>
Install git and zip Install git and zip
@ -66,10 +34,8 @@ apt install git zip -y
``` ```
Clone the repository Clone the repository
```bash ```bash
git clone https://git.moelle.space/hxcde/folder2archive.git git clone https://git.moelle.space/hxcde/folderarchive.git
``` ```
Edit the zip_folder_daily.sh file
<br>
Add the following to cron to automate Backup Add the following to cron to automate Backup
```bash ```bash
0 13 * * * sh /path/to/script/zip_folder_daily.sh 0 13 * * * sh /path/to/script/zip_folder_daily.sh

BIN
f2a.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

View File

@ -13,7 +13,7 @@ echo "# Enter the directory where the zipped files will be stored (e.g., /path/t
echo "Enter the directory where the zipped files will be stored (e.g., /path/to/archive)" echo "Enter the directory where the zipped files will be stored (e.g., /path/to/archive)"
read archive read archive
echo "ARCHIVE_DIR='"$archive"'" >> zip_folder_daily.sh echo "ARCHIVE_DIR='"$archive"'" >> zip_folder_daily.sh
curl https://git.moelle.space/hxcde/folder2archive/raw/branch/main/append >> zip_folder_daily.sh curl https://git.moelle.space/hxcde/folderarchive/raw/branch/main/append >> zip_folder_daily.sh
sh /opt/zip_folder_daily.sh sh /opt/zip_folder_daily.sh
crontab -l > mycron crontab -l > mycron