Yes, this should copy all files in /home/pi/.attract/backup to /home/pi/.attract/romlists. Beware that this wouldn't copy any subdirectories in backup, for those you'd need the -R option for recursive copying:
But if there are only files in backup the -R option isn't needed.
To make a script out of this, just put this in a text file. It is common to begin a Linux shell script with the shebang which defines the interpreter that should be used to run the script. Without the shebang, the shell will use its standard interpreter that, depending on the script, may cause problems if it handles some commands differently. RetroPie's standard interpreter is the bash, located in /bin.
Although this shouldn't be an issue with your simple script, let's give it a shebang for sheer sake of completeness:
Put this into a text file (e.g. sometextfile) and make it executable with this command:
chmod u+x sometextfile
u+x means give the file's user (i.e. owner) execute permissions.
Pro tip: If you put this file into a (new) directory /home/pi/bin, it will be found by the shell from any other directory. Otherwise you'd need to invoke it with its full or relative path. If it's in bin in the home directory of the current user, you can run it from anywhere just by its name in the command console.
As for accessing the script from the Settings section of retropie, I will have to look that up myself since I don't know that off the cuff, but I have to go to work now, so I have to put you off for later. But maybe someone else can take over this part.
Great info... I followed your steps and it works like a charm. I created file in notepadd++ - restore.romlists
Was that the right folder to place my roms in? They are from a 0.78 set - emulation station can see them but not attract mode?
I can't help you with attract-mode setup, I'm not using it. I think you need to add the folder yourself and scan it for ROMs.
I did wonder if the system volume at 0% was the issue but that's something that just wont save when I set it higher?
If you disabled the on-board sound and your USB soundcard is the only output option, then the in EmulationStation the Audio Card should be set to 'Defaut' and the Default Device to PCM or Master (?). But the settings here affect only EmulationStation and not AttractMode or the emulators, so if you're not using EmulationStation, it's ok to leave them at defaults.
@darkmenace That setting should boot Attract Mode into the last display it was on before you quit it last time. You need to quit for it to work though, if you force shutdown or pull the power it won't save where you were. You should set a button for exit (not just back) and exit it from Attract Mode while on your Arcade display. If you then do force shutdowns or pull the power you won't need to do this again.
When you exit Attract Mode does it go to terminal or have you set it to shutdown?
Thanks again BFD. It is now working as expected :)