2023-04-18 15:32:41 +02:00
|
|
|
#!/bin/bash
|
2023-04-18 19:55:25 +02:00
|
|
|
echo checking if Zip is installed
|
|
|
|
apt-get install zip -y
|
|
|
|
yum install zip -y
|
|
|
|
apk add zip
|
2023-04-18 15:29:50 +02:00
|
|
|
cd /opt/
|
2023-04-18 19:46:56 +02:00
|
|
|
echo "#!/bin/bash" > zip_folder_daily.sh
|
2023-04-18 19:49:46 +02:00
|
|
|
echo "#Enter the directory to be zipped (e.g., /path/to/folder)" >> zip_folder_daily.sh
|
|
|
|
echo "Enter the directory to be zipped (e.g., /path/to/folder)"
|
2023-04-18 19:46:56 +02:00
|
|
|
read path
|
2023-04-18 19:53:16 +02:00
|
|
|
echo "SOURCE_DIR='"$path"'" >> zip_folder_daily.sh
|
2023-04-18 19:46:56 +02:00
|
|
|
echo "# Enter the directory where the zipped files will be stored (e.g., /path/to/archive)" >> zip_folder_daily.sh
|
2023-04-18 19:49:46 +02:00
|
|
|
echo "Enter the directory where the zipped files will be stored (e.g., /path/to/archive)"
|
2023-04-18 19:46:56 +02:00
|
|
|
read archive
|
2023-04-18 19:53:16 +02:00
|
|
|
echo "ARCHIVE_DIR='"$archive"'" >> zip_folder_daily.sh
|
2023-04-18 20:00:17 +02:00
|
|
|
curl https://git.moelle.space/hxcde/folderarchive/raw/branch/main/append >> zip_folder_daily.sh
|
2023-04-18 19:54:18 +02:00
|
|
|
sh /opt/zip_folder_daily.sh
|
2023-04-18 19:46:56 +02:00
|
|
|
|
2023-04-18 19:54:18 +02:00
|
|
|
crontab -l > mycron
|
|
|
|
echo "0 13 * * * sh /opt/folderarchive/zip_folder_daily.sh" >> mycron
|
|
|
|
crontab mycron
|
|
|
|
rm mycron
|