Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Update several installations at the same time via ssh

Started by Muut Archive 9 years ago · 2 replies · 362 views
9 years ago

How can I update several installations at the same time via ssh?
For example one grav-installation in folder A, a second grav-installation in folder B.
"bin/gpm update" is only working within a folder.

9 years ago

Got help and found a solution. :-)
Upload a Script (for example update_grav.sh) with the following content:

----```

!/bin/bash

logfile="/path/to/log/upgrav$(date +%Y%m%d)1.log"

j=0
Setups[j++]="/path/to/installation/grav_installation1"
Setups[j++]="/path/to/installation/grav_installation2"
Setups[j++]="/path/to/installation/grav_installation3"

Add more grav setups as above

echo "### $(date +%Y%m%d_%T) starting update of grav installations " 2>&1 | tee -a ${logfile}

for i in "${Setups[@]}"
do
echo "### $(date +%Y%m%d_%T) update directory $i" | tee -a ${logfile} 2>&1
cd "$i"
bin/gpm selfupgrade -y 2>&1 | tee -a ${logfile}
bin/gpm update -y 2>&1 | tee -a ${logfile}
done

echo "### $(date +%Y%m%d_%T) finished update of grav installations " 2>&1 | tee -a ${logfile}

----```

Than, start your script with "sh update_grav.sh" and relax.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1334 9 years ago
Archive · by Muut Archive, 9 years ago
2 925 9 years ago
Archive · by Muut Archive, 9 years ago
2 4056 9 years ago
Archive · by Muut Archive, 9 years ago
1 2939 9 years ago
Archive · by Muut Archive, 9 years ago
3 1112 9 years ago