moving a file location

Associate
Joined
26 Mar 2003
Posts
1,194
Location
UK
Hi everyone,

I have just set up a linux box using opensuse 10.2, I have configured a number of network monitoring tools which run to log network activity on my work network. However when I set it all up I was only concerned with getting everything working as quickly as possible. Now it works I would like to consider the long term storage issues that need to be addressed.

I currently have a 20GB partition (operational and boot partition) and a 200GB (storage partition) my programs look at /var/netflow/ft to store the log files on the 20GB partition, however I would like to remap "/var/netflow/ft" to actually be on the 200GB. I am hoping there is an easy way to do this without reconfiguring all the programs to point at a folder on the 200gb partition.

Any help will be greatly appreciated..

Many thanks

Markwombat
 
Sorry misread it at first and was goign to suggest just mounting your 200GB partition as /var/netflow/ft in your /etc/fstab file.

The short answer is no, you are going to have to manually change your settings. However you could use a shell script and sed to search and replace it globally on multiple files so that should cut down on some of the workload and monotony at least!

something like "sed -e / '\/var\/netflow\/ft' / `\/new\/path\/' /g" should do it? (Ive added extra whitespace to emphasise which slashes are escape chars and which ones are sed regexps.
 
A much easier way would be to copy all the current logfiles across then do
Code:
ln -s /new/storage/location /var/netflow/ft
so that /var/netflow/ft is effectively relocated.
 
Back
Top Bottom