Skip to content

Instantly share code, notes, and snippets.

@FarisHijazi
Last active April 26, 2022 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FarisHijazi/6b67ac9ed9c28d0e085d25e38f024ae2 to your computer and use it in GitHub Desktop.
Save FarisHijazi/6b67ac9ed9c28d0e085d25e38f024ae2 to your computer and use it in GitHub Desktop.
LGHUB backup and restore profiles and settings
echo backing up LGHUB
rm -rf LGHUBlocal LGHUBroaming
cp -r C:/Users/faris/AppData/Local/LGHUB LGHUB-local
cp -r C:/Users/faris/AppData/Roaming/LGHUB LGHUB-roaming
zip -r LGHUB-local-`date +%Y%m%d_%H%M%S`.zip LGHUB-local/*
zip -r LGHUB-roaming-`date +%Y%m%d_%H%M%S`.zip LGHUB-roaming/*
echo restoring LGHUB
LGHUBroaming=$(ls -t1 LGHUB-roaming-*|head -n1)
LGHUBlocal=$(ls -t1 LGHUB-local-*|head -n1)
rm -rf C:/Users/faris/AppData/Roaming/LGHUB-roaming
unzip ${LGHUBroaming} -d C:/Users/faris/AppData/Roaming/
rm -rf C:/Users/faris/AppData/Roaming/LGHUB
mv "C:/Users/faris/AppData/Roaming/LGHUB-roaming" "C:/Users/faris/AppData/Roaming/LGHUB"
rm -rf C:/Users/faris/AppData/Local/LGHUB-local
unzip ${LGHUBlocal} -d C:/Users/faris/AppData/Local/
rm -rf C:/Users/faris/AppData/Local/LGHUB
mv "C:/Users/faris/AppData/Local/LGHUB-local" "C:/Users/faris/AppData/Local/LGHUB"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment