This script takes path and dbname, prints the command (default 0, 1 executes the command). It loops through to get number of files of the actual database. Then it builds the restore script based on number of files. It has some limitations. It can only be one backup of a database in the directory. Since it doesn’t check for the date on the files. But it can be several files of the backup.