• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 372
  • Last Modified:

how to tell a script to write to a new repository location on disk storage?

Currently, I have a script that writes log information to the following directory location, /opt/repository/log_files/ on the local disk partition /dev/sda1 .. What I would like is to have this script write to a more mutual location other than the local disk. In this case, I would have dedicated disk use only for repository log files, /dev/sdb and mount it to /mnt/repository.. How can I tell this script to write log information in the new directory location (/mnt/repository) while keeping the old location /opt/repository/log_files/
0
areyouready344
Asked:
areyouready344
1 Solution
 
Duncan RoeSoftware DeveloperCommented:
Are you talking about the output from the script? If so, use "exec" in the script with no program name but with redirection, e.g.:

exec >/mnt/repository/xxx 2>&1

or, to append:

exec >>/mnt/repository/xxx 2>&1

If your question was about something else, please post clarifying what it is you want to do
0
 
ai_ja_naiCommented:
can you post us the content of the script file?
0
 
areyouready344Author Commented:
The solution I used was to use an USB thumb device to store log files and then created a mount point to this USB device /USB_LOGS
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now