Skip to content
Snippets Groups Projects
Commit 2f7f5f6b authored by Andreas Ellewsen's avatar Andreas Ellewsen
Browse files

Add scripts for CIM

parent 3753cd89
No related branches found
No related tags found
1 merge request!1Add scripts for CIM
[Unit]
Description=CIM cleanup
After=network.target
[Service]
Type=simple
User=bottint
WorkingDirectory=/home/bottint/cim/uib/archive
ExecStart=/usr/local/bin/cim-cleanup.sh
[Install]
WantedBy=multi-user.target
#!/bin/bash
printf "Deleting files older than 30 days"
find . -maxdepth 1 \( -name \*.json -o -name \*.log \) -mtime +30 -delete
[Unit]
Description=Daily UiB temp CIM upload
[Timer]
OnCalendar=4:30
AccuracySec=24h
Persistent=true
[Install]
WantedBy=timers.target
[Unit]
Description=CIM export upload
After=network.target
[Service]
Type=simple
User=bottint
WorkingDirectory=/home/bottint/cim/uib
ExecStart=/usr/local/bin/cim-uib-upload.sh
[Install]
WantedBy=multi-user.target
#!/bin/bash
# Upload script
# upload .json and .log files to remote host
# File names are different, but transfer prod files last just in case
# Test
scp -i /home/bottint/.ssh/cim_id_rsa test/*.json test/*.log sap@cim.uib.no:/mnt/data/SAP/dfo-cim/
mv test/*.json test/*.log test/archive/
#Production
scp -i /home/bottint/.ssh/cim_id_rsa prod/*.json prod/*.log sap@cim.uib.no:/mnt/data/SAP/dfo-cim/ || exit 1
mv prod/*.json prod/*.log prod/archive/
[Unit]
Description=Weekly cim uib export upload
[Timer]
OnCalendar=3:10
AccuracySec=30m
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