Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2009-04-09
3
Medium Priority
?
370 Views
Last Modified: 2012-05-06
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
Comment
Question by:areyouready344
3 Comments
 
LVL 35

Accepted Solution

by:
Duncan Roe earned 1500 total points
ID: 24113037
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
 
LVL 16

Expert Comment

by:ai_ja_nai
ID: 24114333
can you post us the content of the script file?
0
 

Author Comment

by:areyouready344
ID: 24277630
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

Independent Software Vendors: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses
Course of the Month10 days, 12 hours left to enroll

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question