Hi there,
Currently trying to write a backup/restore script but I'm having difficulty getting the restore/extract function to work as desired.
My directory structure is;
/root/scriptfiles/backups
with the scripts being held in:
/root/scriptfiles/
I'm currently using this command, which isn't working and need help with!
tar -xvf /root/scriptfiles/backups/"$filename" /root/scriptfiles/backups/"$filename" > /root/scriptfiles/logfiles/"Restore-$filename"
I'm unsure as to the syntax to use, just a beginner.
What I'm trying to achieve with this script is to take the backed up files from the backup folder and extract them to the /root/ directory and rename of the extracted backed up directory to have "Restore-" at the start of the name.
i.e. Restore-Pictures-backup from Pictures-backup.tar
I hope this makes sence, been doing my head in for a while haha.
Thanks in advance for any guidance
Em