[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master] Add yearly cronjob



---
 config/debian/yearly.functions | 11 +++++++++++
 config/debian/yearly.tasks     |  2 ++
 config/debian/yearly.variables |  2 ++
 3 files changed, 15 insertions(+)
 create mode 100644 config/debian/yearly.functions
 create mode 100644 config/debian/yearly.tasks
 create mode 100644 config/debian/yearly.variables

diff --git a/config/debian/yearly.functions b/config/debian/yearly.functions
new file mode 100644
index 0000000..a13b89b
--- /dev/null
+++ b/config/debian/yearly.functions
@@ -0,0 +1,11 @@
+# -*- mode:sh -*-
+
+function removalsarchive() {
+    cd ${webdir}
+    for ending in txt 822; do
+        mv removals.${ending} removals-${LASTYEAR}.${ending}
+        touch removals.${ending}
+        chmod g+w removals.${ending}
+        chown dak:ftpteam removals.${ending}
+    done
+}
diff --git a/config/debian/yearly.tasks b/config/debian/yearly.tasks
new file mode 100644
index 0000000..b3ab392
--- /dev/null
+++ b/config/debian/yearly.tasks
@@ -0,0 +1,2 @@
+# FUNC                 ARGS                       TIME                       ERR     BG
+removalsarchive        none                       none                       false   false
diff --git a/config/debian/yearly.variables b/config/debian/yearly.variables
new file mode 100644
index 0000000..2c03de3
--- /dev/null
+++ b/config/debian/yearly.variables
@@ -0,0 +1,2 @@
+# -*- mode:sh -*-
+LASTYEAR=$(date -d 'last year' +%Y)
-- 
2.1.4


Reply to: