This script will work when your system running properly. If your server is booted in rescue mode I afraid the script will not function. In rescue mode, you need to mount your hard drive and then copy the data. If you are not sure, how it works you better to ask your provider or else hire professional otherwise one mistake could result in whole data loss and that is not something you want.