Skip to content
Snippets Groups Projects
Commit 49f9b29a authored by Trond Aasan's avatar Trond Aasan
Browse files

Merge branch 'BE-8' into 'master'

BE-8: Scripts to copy berg hansen files over

See merge request !6
parents c7c3d3b3 4aeff3ff
No related branches found
No related tags found
1 merge request!6BE-8: Scripts to copy berg hansen files over
Pipeline #218362 passed
[Unit]
Description=Berg Hansen cleanup
After=network.target
[Service]
Type=simple
User=bottint
WorkingDirectory=/home/bottint/berg-hansen/uio
ExecStart=/usr/local/bin/bh-uio-cleanup.sh
[Install]
WantedBy=multi-user.target
#!/bin/bash
printf "Deleting files older than 30 days"
find ./archive -maxdepth 1 -name \*.json -mtime +30 -delete
[Unit]
Description=Daily UiO Berg Hansen upload
[Timer]
OnCalendar=4:30
AccuracySec=24h
Persistent=true
[Install]
WantedBy=timers.target
[Unit]
Description=Berg Hansen export upload
After=network.target
[Service]
Type=simple
User=bottint
WorkingDirectory=/home/bottint/berg-hansen/uio
ExecStart=/usr/local/bin/bh-uio-upload.sh
[Install]
WantedBy=multi-user.target
#!/bin/bash
# Upload script
set -e
echo "Attempting to transfer Berg-Hansen file for UiO."
printf 'put uio-prod-%s.json' "$(date +'%Y-%m-%d')" | sftp -i /home/bottint/.ssh/berg_hansen_id_rsa -b - sftp.uio@sftp.berg-hansen.no:.
mv /home/bottint/berg-hansen/uio/*.json /home/bottint/berg-hansen/uio/archive/.
[Unit]
Description=Daily Berg Hansen UiO export upload
[Timer]
OnCalendar=21:00
AccuracySec=1m
Persistent=true
[Install]
WantedBy=timers.target
......@@ -2,10 +2,9 @@
Description=Nightly cristin export upload
[Timer]
OnCalendar=4:15
OnCalendar=3:00
AccuracySec=1m
Persistent=true
[Install]
WantedBy=timers.target
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment