I am hoping there is an easy way to do this but...
I am generating a script which essentially copies files to a back up location. The source path and file is generated from a data table (Oracle) so essentially you have:
/oracledata/LIVE/temp.dbf
/redolog1/LIVE/redo01.log
/redolog1/LIVE/redo02.log
to be copied to
/backup/oracledata/LIVE/temp.dbf
/backup/redolog1/LIVE/redo01.log
/backup/redolog1/LIVE/redo02.log
so scriptB needs to be
cp /oracledata/LIVE/temp.dbf /backup/oracledata/LIVE/
cp /redolog1/LIVE/redo01.log /backup/redolog1/LIVE/redo01.log cp /redolog1/LIVE/redo02.log /backup/redolog1/LIVE/redo02.log
In order to keep things "clean" I would start the script by clearing everything from /backup (do I need to name each one or can I generically do this?)
Rather than mkdir /backup/oracledata
then mkdir /nackup/oracledata/LIVE
etc
I am not making myself very clear for which I apologise.
In a nutshell I want to take the following code:
copy to the same path as the source with /backup (&dir) in front.
Thanks!
Applications Support
UK
I am generating a script which essentially copies files to a back up location. The source path and file is generated from a data table (Oracle) so essentially you have:
/oracledata/LIVE/temp.dbf
/redolog1/LIVE/redo01.log
/redolog1/LIVE/redo02.log
to be copied to
/backup/oracledata/LIVE/temp.dbf
/backup/redolog1/LIVE/redo01.log
/backup/redolog1/LIVE/redo02.log
so scriptB needs to be
cp /oracledata/LIVE/temp.dbf /backup/oracledata/LIVE/
cp /redolog1/LIVE/redo01.log /backup/redolog1/LIVE/redo01.log cp /redolog1/LIVE/redo02.log /backup/redolog1/LIVE/redo02.log
In order to keep things "clean" I would start the script by clearing everything from /backup (do I need to name each one or can I generically do this?)
Rather than mkdir /backup/oracledata
then mkdir /nackup/oracledata/LIVE
etc
I am not making myself very clear for which I apologise.
In a nutshell I want to take the following code:
Code:
spool &fil
select 'host cp -p '|| name ||' &dir' from v$datafile order by 1;
select 'host cp -p '|| member ||' &dir' from v$logfile order by 1;
select 'host cp -p '|| name ||' &dir' from v$controlfile order by 1;
select 'host cp -p '|| name ||' &dir' from v$tempfile order by 1;
spool off;
copy to the same path as the source with /backup (&dir) in front.
Thanks!
Applications Support
UK