adhg
September 16th, 2007, 02:12 AM
Hi all,
I'm writing a bash script that creates a backup of my db and send it to a remote site (this will be done on a daily basis and the remote site will have a folder name of the day of backup, eg., 2007-09-09)
When I run the script, I placed some 'echo' to tell what/where the script is doing.
Since this will be done on automatically and on a daily basis, I would like to create a text file that includes all the *echos* and place it under the folder I created for that specific date (just like a log file that tells what happens and if something went wrong)
on the terminal I can do this:
adhg@ubuntu$ ./backup>out.txt
and all echos will go into out.txt. Problem is, of course, that I can't do this in the script:
cp out.txt $remoteFolder
this is because the out.txt is not completed yet :confused:
any idea how to circumvent this problem?
thanks
adhg
I'm writing a bash script that creates a backup of my db and send it to a remote site (this will be done on a daily basis and the remote site will have a folder name of the day of backup, eg., 2007-09-09)
When I run the script, I placed some 'echo' to tell what/where the script is doing.
Since this will be done on automatically and on a daily basis, I would like to create a text file that includes all the *echos* and place it under the folder I created for that specific date (just like a log file that tells what happens and if something went wrong)
on the terminal I can do this:
adhg@ubuntu$ ./backup>out.txt
and all echos will go into out.txt. Problem is, of course, that I can't do this in the script:
cp out.txt $remoteFolder
this is because the out.txt is not completed yet :confused:
any idea how to circumvent this problem?
thanks
adhg