diff options
author | Jeremy Olexa <darkside@gentoo.org> | 2010-09-14 19:36:33 +0000 |
---|---|---|
committer | Theo Chatzimichos <tampakrap@gentoo.org> | 2010-09-15 22:48:11 +0300 |
commit | 0f62de411ad9f6c45741836e68a00a140bf5183e (patch) | |
tree | f4fb1938db95ded3b9aa4e49d773df94c97d35ee | |
parent | cp -r :/ (diff) | |
download | planet-0f62de411ad9f6c45741836e68a00a140bf5183e.tar.gz planet-0f62de411ad9f6c45741836e68a00a140bf5183e.tar.bz2 planet-0f62de411ad9f6c45741836e68a00a140bf5183e.zip |
Use cp -a, check for year dir before copying
-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 04165f6..62d3eed 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 |