如何部署safe-rm
参考地址:https://blog.csdn.net/weixin_57293818/article/details/132810633 下载包 wget https://launchpad.net/safe-rm/trunk/1.1.0/+download/safe-rm-1.1.0.tar.gz #安装make参数 [root@test /data/software/safe-rm-1.1.0]# yum install -y pcre-devel openssl-devel make #make打包报错 [root@test /data/software/safe-rm-1.1.0]# make cargo build --release make: cargo: Command not found make: *** [target/release/safe-rm] Error 127 #修改下载源 [root@test /data/software/safe-rm-1.1.0]# wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo --2024-06-29 09:16:07-- https://mirrors.aliyun.com/repo/epel-7.repo Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 111.62.240.232, 111.62.240.227, 111.62.240.231, ... Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|111.62.240.232|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 664 [application/octet-stream] Saving to: ‘/etc/yum.repos.d/epel.repo’ 100%[================================================================================================================================>] 664 --.-K/s in 0s 2024-06-29 09:16:07 (470 MB/s) - ‘/etc/yum.repos.d/epel.repo’ saved [664/664] #安装cargo [root@test /data/software/safe-rm-1.1.0]# yum -y install cargo #重新运行make命令 [root@test /data/software/safe-rm-1.1.0]# make cargo build --release Updating crates.io index Downloading 1 crate, remaining bytes: 17.4 KB #多了target目录 [root@test /data/software/safe-rm-1.1.0]# ll total 72 -rw-r--r-- 1 ftpuser ftpuser 3769 Jan 6 2021 Cargo.lock -rw-r--r-- 1 ftpuser ftpuser 564 Jan 6 2021 Cargo.toml -rw-r--r-- 1 ftpuser ftpuser 2273 Jan 6 2021 Changes -rw-r--r-- 1 ftpuser ftpuser 35072 Jan 6 2021 COPYING -rw-r--r-- 1 ftpuser ftpuser 560 Jan 6 2021 INSTALL -rw-r--r-- 1 ftpuser ftpuser 640 Jan 6 2021 Makefile -rw-r--r-- 1 ftpuser ftpuser 2569 Jan 6 2021 README.md -rw-r--r-- 1 ftpuser ftpuser 7282 Jan 6 2021 safe-rm.1 -rw-r--r-- 1 ftpuser ftpuser 398 Jan 6 2021 safe-rm.desktop drwxr-xr-x 2 ftpuser ftpuser 41 Jan 6 2021 src drwxr-xr-x 3 root root 65 Jun 29 09:18 target [root@test /data/software/safe-rm-1.1.0]# cd target/ [root@test /data/software/safe-rm-1.1.0/target]# ll total 4 -rw-r--r-- 1 root root 177 Jun 29 09:18 CACHEDIR.TAG drwxr-xr-x 7 root root 137 Jun 29 09:18 release [root@test /data/software/safe-rm-1.1.0/target]# cd release/ #查看safe-me命令 [root@test /data/software/safe-rm-1.1.0/target/release]# ll total 10836 drwxr-xr-x 2 root root 6 Jun 29 09:18 build drwxr-xr-x 2 root root 178 Jun 29 09:18 deps drwxr-xr-x 2 root root 6 Jun 29 09:18 examples drwxr-xr-x 2 root root 6 Jun 29 09:18 incremental -rwxr-xr-x 2 root root 11091296 Jun 29 09:18 safe-rm -rw-r--r-- 1 root root 140 Jun 29 09:18 safe-rm.d #拷贝命令 [root@test /data/software/safe-rm-1.1.0/target/release]#cp /data/software/safe-rm-1.1.0/target/release/safe-rm /usr/sbin/ [root@test /data/software/safe-rm-1.1.0/target/release]#ln -s /usr/sbin/safe-rm /usr/sbin/rm #编辑配置文件 [root@test /data/software/safe-rm-1.1.0/target/release]# vim /etc/safe-rm.conf / /bin /boot /dev /etc /home /lib /lib64 /opt /proc /root /run /sbin /sys /tmp /usr /usr/bin /usr/include /usr/lib /usr/local /usr/local/bin /usr/local/include /usr/local/sbin /usr/local/share /usr/sbin /usr/share /usr/src /var /etc/safe-rm.conf [root@test /data/software/safe-rm-1.1.0/target/release]# rm -f /etc/safe-rm.conf safe-rm: Skipping /etc/safe-rm.conf. #新建目录测试一下删除,确认没有问题
本文作者:wh459086748
本文链接:https://www.cnblogs.com/world-of-yuan/p/18274989
版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。
分类:
Linux
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步