-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add docs #25
Merged
Add docs #25
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
049b0b2
add cleanup.sh and change email
YuWei-CH 35a0469
update corn job Setup
YuWei-CH 97f0914
Update cron time
genericdata 54ba083
python to bash call for cron
genericdata 4805210
update email formatting
YuWei-CH 0c7c007
resolve conflicts
YuWei-CH a168b81
resolve conflicts
YuWei-CH 9c3a414
add comments
YuWei-CH a71d5f7
add staticData setup in install.sh
YuWei-CH 76e55e5
update troubleshooting
YuWei-CH e788d1c
add gitignore for staticData
YuWei-CH File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
# This script is designed to manage and clean up old directories and files within the ./downloads folder. | ||
# Its primary purpose is to delete directories and their contents that are older than 1 week (168 hours) to free up disk space | ||
# and maintain a clean file system. This script will iterate through all the files in the ./downloads folder | ||
# and delete all sub-folders and files if the folder was created more than 1 week ago. If there are files in this folder, | ||
# the files will also be deleted one by one. | ||
|
||
# Define path to the downloads directory | ||
download_folder="./downloads/" | ||
# cutoffMins = 1 week ago = 168 hours ago (in seconds) | ||
cutoffMins=$((169 * 60)) # add 1 hour to handle edge case, which is job finished at 1:00 am. | ||
|
||
# Traverse the download folder and remove directories older than cutoff time | ||
# -mindepth 1: Excludes the top-level directory, includes only subdirectories | ||
find "$download_folder" -mindepth 1 -type d -mmin +$((cutoffMins)) | while read -r dirpath; do | ||
# echo "$dirpath" | ||
if [ -d "$dirpath" ]; then | ||
timestamp=$(date '+%Y-%m-%d %H:%M:%S') | ||
rm -rf "$dirpath" | ||
# Captures the success of the rm command | ||
result=$? | ||
if [ $result -eq 0 ]; then | ||
echo "Removed old directory: $dirpath - $timestamp" | ||
else | ||
echo "Error removing directory: $dirpath - $timestamp" | ||
fi | ||
fi | ||
done | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we add this to .gitignore? Especially when the static files are so large. Probably too large for github. We can investigate using the test data from the reform repo, https://github.com/gencorefacility/reform/tree/master/test_data.