每天凌晨3点30分 我有一个日记 来创建数据库备份
文件名的缩略语是 liver_YYYYYY_MM_DD.sql.gz, YYYYY、 MM 和 DD 是备份日的日期 。
通常情况下,我进去删除旧的备份,但我想将备份数量限制在3个最新备份。 有没有办法通过某种程序或脚本做到这一点?
谢谢 谢谢
编辑 :
我根据
每天凌晨3点30分 我有一个日记 来创建数据库备份
文件名的缩略语是 liver_YYYYYY_MM_DD.sql.gz, YYYYY、 MM 和 DD 是备份日的日期 。
通常情况下,我进去删除旧的备份,但我想将备份数量限制在3个最新备份。 有没有办法通过某种程序或脚本做到这一点?
谢谢 谢谢
编辑 :
我根据
简单的 shell 脚本可以完成此项任务, 但您最好学习一下用于完成此任务的标准工具 : < a href=" http://linuxcommander.org/ man_ pages/logrotate8. html" rel=“ nofollow” >logrotate 。 当您需要更老的备份文件管理修改时, 而不是修改家用版本的脚本, 它只是更改对数配置条目的问题 。
ls -t live_*.sql.gz|awk NR>3 |xargs echo
如果这回响了正确的文件, 请使用 < code> rm code > 而不是 < code> > echo code > 。 将其放在备份脚本中的适当位置, 不需要安装对数 。
What is the pre requisite to be able to use Unix s rlogin command? Regards Chaitanya
I would like to know how to generate assembler code from a C program using Unix. I tried the gcc: gcc -c file.c I also used firstly cpp and then try as but I m getting errors. I m trying to build an ...
I am creating scripts which will store the contents of pipe delimited file. Each column is stored in a separate array. I then read the information from the arrays and process it. There are 20 pipe ...
This program supposed to find command line arguments entered on Unix which ends with “.exe”. For some reason it doesn t work. Here is the code: int main( int argc, char* argv[] ) { for ( int ...
So I created a symlink: ln -s /location/to/link linkname Now I want to change the location that the symlink links to. How do I do that? is there a way to do it without deleting it first?
I run a large data warehouse plant where we have a lot of nightly jobs running concerruently however many have dependencies on a extract or data load process before they start. Currently we use an ...
I ll write a program for Interactive UNIX (http://en.wikipedia.org/wiki/INTERACTIVE_UNIX). But in a year it will be ported to Windows. I ll write it in ANSI C and/or SH-script. When it runs on Windows ...
What are your recommendations for setting up a development environment in Windows, especially when not using an IDE. I am attempting to familiarize myself with Windows, and I feel a bit lost. What ...