Monday, August 10, 2009

5.5.3.X Upgrade

What happens when you upgrade or you incorrectly modify a license file and some (or all accounts) are set to suspended, infile delta disabled, and shadow copy disabled? Instead of logging into the system and spending hours clicking enable on each account, the following works perfectly in Linux.

==============================
cd /directory/above/userfolder
ls userfolder >/tmp/modify.txt
for n in `cat /tmp/modify.txt`
do
curl 'http://localhost/obs/api/ModifyUser.do?SysUser=SYSUSER&SysPwd=SYSPASSWORD&LoginName='$n'&Status=ENABLE'

curl 'http://localhost/obs/api/ModifyUser.do?SysUser=SYSUSER&SysPwd=SYSPASSWORD&LoginName='$n'&EnableShadowCopy=Y'
curl 'http://localhost/obs/api/ModifyUser.do?SysUser=SYSUSER&SysPwd=SYSPASSWORD&LoginName='$n'&EnableInFileDelta=Y'
done
==============================

NOTE: EACH curl is one line (it's wrapping due to the length)


EXAMPLE
User storage is /storage/users
syspass: PEAK
password: BACKUP

cd /storage
ls users>/tmp/modify.txt
for n in `cat /tmp/modify.txt`
do
curl 'http://localhost/obs/api/ModifyUser.do?SysUser=PEAK&SysPwd=BACKUP&LoginName='$n'&Status=ENABLE'
curl 'http://localhost/obs/api/ModifyUser.do?SysUser=PEAK&SysPwd=BACKUP&LoginName='$n'&EnableShadowCopy=Y'
curl 'http://localhost/obs/api/ModifyUser.do?SysUser=PEAK&SysPwd=BACKUP&LoginName='$n'&EnableInFileDelta=Y'

done