简体   繁体   English

重新启动后符号链接消失

[英]Symbolic Link disappears after restart

I'm running Mac OS X 10.8.4 我正在运行Mac OS X 10.8.4

I make the following symbolic link 我做了以下符号链接

ln -s /Users/AlyssaPHacker/mysql/mysql.sock /tmp/mysql.sock

But every time I restart the computer, the symbolic link disappears and I have to create it again. 但每次重新启动计算机时,符号链接都会消失,我必须再次创建它。 Does anyone know how to get around this? 有谁知道怎么解决这个问题?

The /tmp directory is emptied when the system boots so your link is lost. 系统启动时, /tmp目录将被清空,因此您的链接将丢失。

You can use the special cron @reboot entry to run your command during each boot: 您可以使用特殊的cron @reboot条目在每次启动期间运行命令:

@reboot ln -s /Users/AlyssaPHacker/mysql/mysql.sock /tmp/mysql.sock

in the crontab file - see the man page 在crontab文件中 - 请参见手册页

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM