php shell_exec:如何将目录从一个用户复制到另一个用户(CentOs5 上的 VPS)
在 CentOS5 + DirectAdmin 上运行。
我拥有一个 VPS,但出于安全原因,我只想将所有管理权仅授予“经销商”用户。
对于经销商用户,我有一个脚本,它连接到经销商 DA 并创建一个用户。
我的问题是 - 如何复制包含约 10000 个文件的目录树,该目录树位于“经销商用户”ftp 中,例如。 /domains/hoster.dom.com/public_html/dir_to_be_copied
到新创建的用户,我知道该用户的密码和用户名。
据我了解,应该可以通过“shell_exec()”命令将其作为内部服务器操作来执行。
另外,登录另一个用户 FTP 并使用他的文件的命令是什么。是否可以同时连接到两个 FTP 用户,并从一个用户复制到另一个用户。
- 我知道可能建议以“root”用户身份进行此日志记录,但也许无需访问“root”用户也是可能的。
谢谢。
In Running on CentOS5 + DirectAdmin.
I own a VPS, but for security reasons I just want to give all managenent only to 'reseller' user.
With a resseler user I have script, which connects to ressellers DA and creates an user.
My problem is - how to copy a directory tree with ~10000 of files, which is located in 'resellers user' ftp, ex. /domains/hoster.dom.com/public_html/dir_to_be_copied
to a new created user, which password and user name I know.
As i understand, it should be possible to do this as internal server action via 'shell_exec()' command.
Also, what is the command to login another user FTP and work with his files. And is it possible to be connected at the same time to the two FTP users, and make copies from one to another.
- I know that it may be suggested to do this logging as 'root' user, but maybe it is possible without accessing a 'root' user.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
http://www.php.net/manual/en/function。复制.php#91256
http://www.php.net/manual/en/function.copy.php#91256