LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Move folder to other location (https://www.linuxquestions.org/questions/linux-newbie-8/move-folder-to-other-location-4175612430/)

fohnbit 08-22-2017 08:41 AM

Move folder to other location
 
Hello,

is it possible, for example, to move folder:
/var/log/

to the location
/media/card/log


So any programm which write to /var/log is now wrinting to /media/card/log

I know with mount I can mount a folder to a partition. But I need several different folder at /media/card which ist mounted from mmcblk0p1

Thank you!

jsbjsb001 08-22-2017 08:43 AM

Quote:

Originally Posted by fohnbit (Post 5750891)
Hello,

is it possible, for example, to move folder:
/var/log/

to the location
/media/card/log


So any programm which write to /var/log is now wrinting to /media/card/log

I know with mount I can mount a folder to a partition. But I need several different folder at /media/card which ist mounted from mmcblk0p1

Thank you!

A better question, WHY?

TxLonghorn 08-22-2017 12:09 PM

Open /etc/fstab in your text editor, and add this line:
Code:

/media/card/log  /var/log/  none bind
Save the file and exit the editor, then:
Code:

sudo mount -a

jefro 08-22-2017 03:49 PM

I think there are many older and newer programs that will try to write to /var. Not sure you can change it on that side. You might be able to copy or move contents based on some script. An idea at this. https://unix.stackexchange.com/quest...rent-directory


All times are GMT -5. The time now is 06:39 PM.