我想通过清除所有 locate 条目及其数据库来删除。
我试过
apt-get purge locate
Run Code Online (Sandbox Code Playgroud)
和
rm /etc/updatedb*
Run Code Online (Sandbox Code Playgroud)
但是数据库也消失了吗?
在 debian Squeeze 上,updatedb 数据库在哪里?
我也想手动删除它,所以我可以干净地重新安装它
我在我的服务器上使用 monit 来监控 apache 和 mysql 的运行。
现在我想在磁盘太满时添加警报。我添加了这个用于测试/etc/monit/monitrc:
check device rootfs with path /dev/md0
if space usage > 10% then alert
Run Code Online (Sandbox Code Playgroud)
我有两个要检查的分区:/和/var:
mount
/dev/md0 on / type ext3 (rw)
/dev/md2 on /var type ext3 (rw)
Run Code Online (Sandbox Code Playgroud)
除了磁盘空间之外,此配置中还有哪些有用的检查?
我想通过 IPv6 地址访问此地址:http :
//downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/
在我们的 Freifunk 路由器中,没有可用的 DNS,因此downloads.openwrt.org无法解析名称。互联网上的所有服务器只能通过 ipv6 地址访问。现在我们无法从路由器内部访问这个包镜像 t 通过opkg install.
这将是一个解决方案,如果我们可以将其添加到我们的配置中,例如:
http://[2001:db8::1]/attitude_adjustment/12.09/ar71xx/generic/packages/
Run Code Online (Sandbox Code Playgroud)
我们的路由器正在运行 OpenWRT 并且仅支持 IPv6,我想添加一个条目,/etc/hosts以便域名downloads.openwrt.org将解析为适当的 IPv6 地址
是否可以将 IPv6 重定向到域?
我收到这些错误:
Jul 5 11:09:25 relay postfix/smtp[3084]: connect to ab.xyz.com[10.41.0.101]:25: Connection refused
Jul 5 11:09:25 relay postfix/smtp[3087]: connect to ab.xyz.com[10.41.0.247]:25: Connection refused
Jul 5 11:09:25 relay postfix/smtp[3088]: connect to ab.xyz.com[10.41.0.101]:25: Connection refused
Jul 5 11:09:25 relay postfix/smtp[3084]: connect to ab.xyz.com[10.41.0.247]:25: Connection refused
Jul 5 11:09:25 relay postfix/smtp[3087]: connect to ab.xyz.com[10.41.0.110]:25: Connection refused
Jul 5 11:09:25 relay postfix/smtp[3088]: connect to ab.xyz.com[10.41.0.110]:25: Connection refused
Jul 5 11:09:25 relay postfix/smtp[3084]: connect to ab.xyz.com[10.41.0.102]:25: Connection refused
Jul 5 11:09:30 relay postfix/smtp[3085]: connect to ab.xyz.com[10.41.0.102]:25: Connection …Run Code Online (Sandbox Code Playgroud) 我需要转储一个包含 50 个奇数表的数据库,其中我想排除大约 15 个带有前缀的奇数表 exam_
我尝试过mysqldump --ignore-table=dbname.exam_* 甚至尝试过--ignore-table=dbname.exam_%
它没有按预期工作。我不得不--ignore-table多次使用。
编辑:我看到了一些列出tables not like tablename_%并将其传递给mysqldump.
但是,我想知道 mysqldump 或 mysql 中是否有选项,因此无需编写脚本即可执行相同操作。
编辑添加:最终使用脚本转储数据库,不包括表,ignore-table=多次使用。
我的 debian (squeeze) 服务器上的 updatedb 数据库很慢。
*/.git/*, */.svn/*和类似的路径?PRUNEPATHS?我/etc/updatedb.conf看起来像这样:
...
# filesystems which are pruned from updatedb database
PRUNEFS="NFS nfs nfs4 afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs shfs sysfs cifs lustre_lite tmpfs usbfs udf"
export PRUNEFS
# paths which are pruned from updatedb database
PRUNEPATHS="/tmp /usr/tmp /var/tmp /afs /amd /alex /var/spool /sfs /media /var/backups/rsnapshot /var/mod_pagespeed/"
...
Run Code Online (Sandbox Code Playgroud)
编辑:
/var/cache/locate/locatedblocate / …我已经使用下面的配置设置了 rsnapshot,它似乎工作正常。但是,如果我理解我正确阅读的内容,在 rsnapshot 文档和其他教程中,添加这些选项后操作会更加健壮:
link_dest 1
sync_first 1
use_lazy_deletes 1
Run Code Online (Sandbox Code Playgroud)
但是,当我启用这些功能时,尤其是 sync_first,它似乎无法正常运行。没有错误,但似乎没有发生任何事情(请参阅下面的最后一个代码块)。Configtest 成功。我怀疑我遗漏了一些关于如何使用 sync_first 的信息。我想首先知道这三个选项在一起使用时是否确实有益(没有冲突),其次,在启用 sync_first 后,我必须在 cron 中调用 rsnapshot 的方式有什么不同吗?
它安装在带有 rsnapshot 1.3.1 的 Ubuntu 14.04 上,并且 rsync 具有 link_dest 选项。感谢您对此的任何指示,官方文档有点枯燥。
会议
config_version 1.2
snapshot_root /srv/rsnapshot/
no_create_root 0
cmd_cp /bin/cp
cmd_rm /bin/rm
cmd_rsync /usr/bin/rsync
cmd_ssh /usr/bin/ssh
cmd_logger /usr/bin/logger
cmd_du /usr/bin/du
cmd_rsnapshot_diff /usr/bin/rsnapshot-diff
retain HoursAgo 6
retain DaysAgo 7
retain WeeksAgo 4
#retain monthly 3
verbose 5
loglevel 3
logfile /var/log/rsnapshot.log
lockfile /var/run/rsnapshot.pid
rsync_long_args --stats --delete --numeric-ids --relative --delete-excluded
ssh_args …Run Code Online (Sandbox Code Playgroud) 端口 80 上的最小网络服务器将是
python -m SimpleHTTPServer 80
Run Code Online (Sandbox Code Playgroud)
但我想始终只显示一页maintenance.html,无论请求什么页面。
浏览器中的 url 应该仍然是访问者请求的 url,但没有错误页面。
我试过这个 bash 命令:
find /var/www/ -path '*wp-admin/index.php' -exec mv {} $(dirname {})/index_disabled
Run Code Online (Sandbox Code Playgroud)
但是第二个{}没有执行。
结果只是./index_disabled相反。
如何在执行命令中两次使用找到的参数?
我被错误所困扰
directive 'register_globals' is no longer available in PHP in unknown on line 0
Run Code Online (Sandbox Code Playgroud)
register_globals在 php.ini 文件中启用后尝试使用“php -v”检查 php 版本时。这样做我没有得到任何 php 版本信息。相反,它会抛出上述错误。关闭此选项后,php info 运行良好。打开 register_globals 对我来说非常重要。我该如何纠正这个问题。
我php.ini的如下:
; Default Value: None
; Development Value: "GP"
; Production Value: "GP"
; http://php.net/request-order
request_order = "GP"
; Whether or not to register the EGPCS variables as global variables. You may
; want to turn this off if you don't want to clutter your scripts' global scope
; with user …Run Code Online (Sandbox Code Playgroud) 我想检查我服务器上的所有二进制文件
dpkg -e <path_to_deb_package> <destination>
Run Code Online (Sandbox Code Playgroud)
(例如,rkhunter 可以在进行 probupdate 时对原件进行此检查)
如何使用一个脚本检查所有包?
我只需要在 Apache 2.4 中将http://example.org/重定向到http://www.something-other.org/ 。
只是主页。没有其他的。即http://example.org/?page=blog或http://example.org/contact.html不应重定向。
我所能找到的就是将页面完全重定向到另一个网站,例如:
Redirect "/" "http://www.something-other.org/"
Run Code Online (Sandbox Code Playgroud)
这更好一点:
RewriteEngine On
RewriteRule ^/$ http:// www.something-other.org/ [L,R=301]
Run Code Online (Sandbox Code Playgroud)
它仅重定向主页,而且如果有查询字符串也会重定向。