复制 cron 运行上的所有文件 - 常规任务
我有一台虚拟专用服务器(运行 FreeBSD 6.x),我需要定期将文件从一个文件夹备份到另一个文件夹,例如 /home/LOGIN/data/www/mydomain.com/test1 到/home/LOGIN/data/www/mydomain.com/test2。我尝试了不同的方法:
rsync -a /home/LOGIN/data/www/mydomain.com/test1 /home/LOGIN/data/www/mydomain.com/test2
cp /home/LOGIN/data/www/mydomain.com/test1 /home/LOGIN/data/www/mydomain.com/test2
cp www/mydomain.com/test1 /www/mydomain.com/test2
但所有这些都不起作用,它给出了错误 #127 和其他错误。
据我所知,这也可以使用由 cron 运行的 php 脚本来完成。
什么是更好的方法?
I've got a virtual dedicated server (running FreeBSD 6.x) and I need to regulary backup files from one folder to another, say from /home/LOGIN/data/www/mydomain.com/test1 to /home/LOGIN/data/www/mydomain.com/test2. I've tried different approaches:
rsync -a /home/LOGIN/data/www/mydomain.com/test1 /home/LOGIN/data/www/mydomain.com/test2
cp /home/LOGIN/data/www/mydomain.com/test1 /home/LOGIN/data/www/mydomain.com/test2
cp www/mydomain.com/test1 /www/mydomain.com/test2
but all this didn't work, it gave error #127 and others.
AFAIK this can be done using a php script to run by cron also.
what is the better way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试
并确保 test2 目录存在
try
and make sure the test2 directory is existent