Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #43 from AlxisHenry/develop
Browse files Browse the repository at this point in the history
Crontab
  • Loading branch information
AlxisHenry committed Jan 23, 2023
2 parents 55afef2 + 744fec8 commit 29c0c41
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions utils/cron.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This script is made to set a cron task used to save your shared files
# To configure the cron, change the variable below:

source utils/tools.sh;

# Path to shared folder
shared="/var/www/cdn.alexishenry.eu/public/shared";

# Save folder path
saved="/home/alexis/save_my_files";

function crontab() {
if [[ ! -d ${saved} ]]; then
throw "Save folder specified [ ${saved} ] does not exist" true;
elif [ "$EUID" -ne 0 ]; then
throw "Please, run this script as root" true;
fi
echo "cp -r ${shared} ${saved}/cdn_save_\$(date +%s)" > /etc/cron.hourly/cdn-autosave
}

crontab;

0 comments on commit 29c0c41

Please sign in to comment.