When backing up files in Centos7, add the backup date to the backup file

When backing up files in Centos7, add the backup date to the backup file

Linux uses files as the basis to manage the devices, interfaces, files, startup and application software in the system. Because in this process, the .conf files, script software, shell, etc. of the application system are required to be backed up before editing. Generally, when I operate important files, I always back them up first, such as:

01. Create a new file

#echo "test copy.." > /home/hdnnadmin/test-copy 

02. Spare parts test-copy file

#cp /home/hdnnadmin/test-copy /home/hdnnadmin/test-copy-bak

Or #cp /home/hdnnadmin/test-copy{,-bak}

View the backup results

03. How to add backup time

#cp /home/hdnnadmin/test-copy{,_back_`date '+%Y%m%d%H%M'`}

View backup results

At this time, it is displayed where the spare part date is added in the backup file

Summarize

The above is what I introduced to you about adding spare parts date to backup files when backing up files in Centos7. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • CentOS7 enables MySQL8 master-slave backup and daily scheduled full backup (recommended)
  • Rsync+crontab regular synchronization backup under centos7
  • How to backup and restore Redis data in Centos7

<<:  JS implements array filtering from simple to multi-condition filtering

>>:  Detailed explanation of how to view the current number of MySQL connections

Recommend

mysql wildcard (sql advanced filtering)

Table of contents First, let's briefly introd...

Linux uses shell scripts to regularly delete historical log files

1. Tools directory file structure [root@www tools...

Example of using nested html pages (frameset usage)

Copy code The code is as follows: <!DOCTYPE ht...

Detailed explanation of the use of stat function and stat command in Linux

stat function and stat command Explanation of [in...

Memcached method for building cache server

Preface Many web applications store data in a rel...

Deep understanding of line-height and vertical-align

Several concepts Line box: A box that wraps an in...

The most complete package.json analysis

Table of contents 1. Overview 2. Name field 3. Ve...

Example code for implementing div concave corner style with css

In normal development, we usually use convex roun...

Let's talk about the characteristics and isolation levels of MySQL transactions

The Internet is already saturated with articles o...

MySQL table and column comments summary

Just like code, you can add comments to tables an...

HTML Tutorial: Ordered Lists

<br />Original text: http://andymao.com/andy...

MySQL 5.7.15 installation and configuration method graphic tutorial (windows)

Because I need to install MySQL, I record the ins...

MySQL kill command usage guide

KILL [CONNECTION | QUERY] processlist_id In MySQL...

IE8 Beta 1 has two areas that require your attention

<br />Related articles: Web skills: Multiple...