add new versions
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
apiVersion: v1
|
||||
data:
|
||||
export_calendar.sh: |
|
||||
#!/usr/bin/env bash
|
||||
apk update
|
||||
apk add curl
|
||||
list='capgemini birmingham cesi papa blueberry personal-1 prometheus birthday maman capgemini_ca-gip shared_shared_by_calendar_sync'
|
||||
for element in $list;do
|
||||
curl -u $PI_USER_USERNAME:$PI_USER_PASSWORD https://nextcloud.tryton.geeraert.eu/remote.php/dav/calendars/pi/$element/\?export -o /backup/calendar_$element.ics
|
||||
done
|
||||
#curl -u $PI_USER_USERNAME:$PI_USER_PASSWORD https://nextcloud.tryton.geeraert.eu/remote.php/dav/calendars/pi/capgemini_ca-gip/\?export -o /backup/calendar.ics
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: nextcloud-calendar-export-script
|
||||
@@ -21,19 +21,24 @@ spec:
|
||||
secretKeyRef:
|
||||
name: nextcloud-credentials
|
||||
key: PI_USER_PASSWORD
|
||||
command: ["/bin/sh","/config/export_calendar.sh"]
|
||||
command: ["/bin/sh","/config/export_notes.sh"]
|
||||
volumeMounts:
|
||||
- name: calendar
|
||||
- name: nextcloud-webserver
|
||||
mountPath: /var/www/html
|
||||
- name: notes
|
||||
mountPath: /backup
|
||||
- name: scripts
|
||||
mountPath: /config
|
||||
volumes:
|
||||
- name: calendar
|
||||
- name: notes
|
||||
persistentVolumeClaim:
|
||||
claimName: calendar
|
||||
claimName: notes
|
||||
- name: nextcloud-webserver
|
||||
persistentVolumeClaim:
|
||||
claimName: nextcloud-webserver
|
||||
- name: scripts
|
||||
configMap:
|
||||
name: nextcloud-calendar-export-script
|
||||
name: nextcloud-export-scripts
|
||||
defaultMode: 0555
|
||||
restartPolicy: Never
|
||||
backoffLimit: 4
|
||||
@@ -41,7 +46,7 @@ spec:
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: calendar
|
||||
name: notes
|
||||
namespace: nextcloud
|
||||
spec:
|
||||
storageClassName: nfs-backup-storage-intelligent
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: nextcloud-contact-backup
|
||||
namespace: nextcloud
|
||||
spec:
|
||||
schedule: "0 0 * * *"
|
||||
jobTemplate:
|
||||
spec:
|
||||
ttlSecondsAfterFinished: 100
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: contact-backup
|
||||
image: alpine/curl
|
||||
env:
|
||||
- name: PI_USER_USERNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: nextcloud-credentials
|
||||
key: PI_USER_USERNAME
|
||||
- name: PI_USER_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: nextcloud-credentials
|
||||
key: PI_USER_PASSWORD
|
||||
args:
|
||||
- -u
|
||||
- $(PI_USER_USERNAME):$(PI_USER_PASSWORD)
|
||||
- https://nextcloud.tryton.geeraert.eu/remote.php/dav/addressbooks/users/pi/contacts/?export
|
||||
- -o
|
||||
- /backup/contact.vcf
|
||||
volumeMounts:
|
||||
- name: contact
|
||||
mountPath: /backup
|
||||
volumes:
|
||||
- name: contact
|
||||
persistentVolumeClaim:
|
||||
claimName: contact
|
||||
restartPolicy: Never
|
||||
---
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: contact
|
||||
namespace: nextcloud
|
||||
spec:
|
||||
storageClassName: nfs-backup-storage-intelligent
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
resources:
|
||||
requests:
|
||||
storage: 2Gi
|
||||
@@ -17,6 +17,13 @@ data:
|
||||
today_date=$(date "+%Y-%m-%d")
|
||||
mkdir /backup/$today_date
|
||||
curl -u $PI_USER_USERNAME:$PI_USER_PASSWORD https://nextcloud.tryton.geeraert.eu/remote.php/dav/addressbooks/users/pi/contacts/?export -o /backup/$today_date/contact_$today_date.vcf
|
||||
export_notes.sh: |
|
||||
#!/usr/bin/env bash
|
||||
today_date=$(date "+%Y-%m-%d")
|
||||
mkdir /backup/$today_date
|
||||
cp /var/www/html/data/pi/files/Notes/*.md /backup/$today_date/
|
||||
# curl -u $PI_USER_USERNAME:$PI_USER_PASSWORD https://nextcloud.tryton.geeraert.eu/remote.php/dav/addressbooks/users/pi/contacts/?export -o /backup/$today_date/contact_$today_date.vcf
|
||||
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
|
||||
Reference in New Issue
Block a user