亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 1585 | 回復: 2
打印 上一主題 下一主題

我想備份今天生成的文件,用set失敗。求助ing [復制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2012-01-06 11:37 |只看該作者 |倒序瀏覽
-rw-r----- 1 oracle dba  556 Dec 30 15:58 test.log.bak
-rw-r----- 1 oracle dba  556 Dec 30 16:08 test.log
-rw-r----- 1 oracle dba 1427 Dec 30 18:25 rman_bak.sh
-rw-r--r-- 1 oracle dba  695 Dec 31 00:02 expdb.log
-rw-r----- 1 oracle dba  948 Dec 31 17:57 test.sh
-rw-r----- 1 oracle dba  152 Dec 31 18:02 test1.sh
-rw-r----- 1 oracle dba    0 Jan  6 11:37 111.txt
-rw-r----- 1 oracle dba    0 Jan  6 11:37 222.txt

我想實現(xiàn)一個功能,備份今天生成的文件,用下面的腳本沒有辦法獲取到文件

腳本如下


set $(date)

V_Month=$2
V_Day=$3
V_MoDy=$2" "$3
ls -lrt |grep ^-|grep "$V_MoDy"|awk '{print $9}'|xargs tar -cf backup_`date +%Y%m%d`.tar


ls -lrt |grep "$V_MoDy" 沒有結(jié)果。

date的顯示格式。

Fri Jan  6 11:42:56 CST 2012



還有別的辦法嗎?求助。

論壇徽章:
95
程序設(shè)計版塊每日發(fā)帖之星
日期:2015-09-05 06:20:00程序設(shè)計版塊每日發(fā)帖之星
日期:2015-09-17 06:20:00程序設(shè)計版塊每日發(fā)帖之星
日期:2015-09-18 06:20:002015亞冠之阿爾艾因
日期:2015-09-18 10:35:08月度論壇發(fā)貼之星
日期:2015-09-30 22:25:002015亞冠之阿爾沙巴布
日期:2015-10-03 08:57:39程序設(shè)計版塊每日發(fā)帖之星
日期:2015-10-05 06:20:00每日論壇發(fā)貼之星
日期:2015-10-05 06:20:002015年亞冠紀念徽章
日期:2015-10-06 10:06:482015亞冠之塔什干棉農(nóng)
日期:2015-10-19 19:43:35程序設(shè)計版塊每日發(fā)帖之星
日期:2015-10-21 06:20:00每日論壇發(fā)貼之星
日期:2015-09-14 06:20:00
2 [報告]
發(fā)表于 2012-01-06 12:02 |只看該作者
回復 1# xcsars


    用 find 吧,比你那個方便多了。

論壇徽章:
0
3 [報告]
發(fā)表于 2012-01-06 14:23 |只看該作者
find - search for files in a directory hierarchy

SYNOPSIS
       find [-H] [-L] [-P] [path...] [expression]
for example:
       -anewer file
              File  was last accessed more recently than file was modified.  If file is a symbolic link and the -H option or the -L option is
              in effect, the access time of the file it points to is always used.

       -atime n
              File was last accessed n*24 hours ago.  When find figures out how many 24-hour periods ago the  file  was  last  accessed,  any
              fractional part is ignored, so to match -atime +1, a file has to have been accessed at least two days ago.

       -cmin n
              File status was last changed n minutes ago.

       -cnewer file
              File  status  was  last changed more recently than file was modified.  If file is a symbolic link and the -H option or the -L
              option is in effect, the status-change time of the file it points to is always used.

       -ctime n
              File status was last changed n*24 hours ago.  See the comments for -atime to understand how rounding affects the  interpreta-
              tion of file status change times.


例子:
              find . -mtime 1  -exec ls -l '{}' \;           #我這樣好像只是把今天內(nèi)的所有文件都列出來了
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP