diff options
-rwxr-xr-x | scripts/update-venus | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/update-venus b/scripts/update-venus index 04165f63..62d3eed7 100755 --- a/scripts/update-venus +++ b/scripts/update-venus @@ -40,8 +40,11 @@ rm -f ${BASE_DIR}generated_configs/venus.{planet,universe}.ini # Delete old logs find ${BASE_DIR}logs -type f -mtime +30 -delete -# Archive posts -cp ${BASE_DIR}htdocs/index.html \ +# Check for year directory, if not there create both needed +[[ -d ${BASE_DIR}htdocs/archives/$(date +%G) ]] || \ + mkdir ${BASE_DIR}htdocs/{,universe/}archives/$(date +%G) +# Archive posts, use -a to retain readable permissions +cp -a ${BASE_DIR}htdocs/index.html \ ${BASE_DIR}htdocs/archives/$(date +%G)/${DATE}.html -cp ${BASE_DIR}htdocs/universe/index.html \ +cp -a ${BASE_DIR}htdocs/universe/index.html \ ${BASE_DIR}htdocs/universe/archives/$(date +%G)/${DATE}.html |