bitwarden-backup-crontab
crontab -l
crontabl -e
0 0 * * * /opt/bitwarden-backup/bw-data-backup.sh >> /opt/bitwarden-backup/backup.log && find /home/appadmin/bitwarden-backup/ -type f -name "bw-data_backup_*" -mtime +7 -exec rm {} \;
更换到挂载存储之后超过七天的文件没有删除,不知道为什么,换一种方式试试:
0 0 * * * /opt/bitwarden-backup/bw-data-backup.sh >> /opt/bitwarden-backup/backup.log && find /home/appadmin/bitwarden-backup/ -type f -name "bw-data_backup_*" |xargs rm -f
压缩
tar -czvf /path/to/file.tar.gz file
解压
tar -xzvf /path/to/file.tar.gz
加密压缩
tar -czvf - file | openssl des3 -salt -k password -out /path/to/file.tar.gz
for example:
tar -czvf - runshtest | openssl des3 -salt -k password -out ../1.tar.gz
解密解压
openssl des3 -d -k password -salt -in /path/to/file.tar.gz | tar xzf -
````
for example:
openssl des3 -d -k password -salt -in 1.tar.gz | tar xzf -
openssl enc -des3 -d -in bw-data_backup_2024-05-22_00-00-01.des3 -out bitwarden_backup.tar.gz -k password && tar -xzvf bitwarden_backup.tar.gz