Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
我想每天自动备份一个文档,请问该怎么写Shell?谢谢!!
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index 中文 (Chinese)
View previous topic :: View next topic  
Author Message
Jasonchen1987
n00b
n00b


Joined: 24 Oct 2008
Posts: 1

PostPosted: Fri Oct 24, 2008 1:54 am    Post subject: 我想每天自动备份一个文档,请问该怎么写Shell?谢谢!! Reply with quote

可不可以给我一个具体的流程,谢谢。
我是这么写的:
vi /etc/apt.sh
#! /bin/bash
tar -zcf first_cron.tar.gz /etc/first.sh 2>/dev/null

:wq

chmod uog=rwx /etc/apt.sh

vi /etc/crontab
增加下面的一行shell
01 09 * * * root /etc/apt.sh

但是系统就是不执行。谁能告诉我在那个环节出了问题?谢谢。
Back to top
View user's profile Send private message
druggo
Apprentice
Apprentice


Joined: 24 Sep 2003
Posts: 289
Location: Hangzhou, China

PostPosted: Fri Oct 24, 2008 8:13 am    Post subject: Reply with quote

cron的守护进程启动了吗?
如果启动了,看看日志有什么提示
grep cron /var/log/messages
_________________
HighWayToHell(blog)
http://blog.druggo.org/
Back to top
View user's profile Send private message
SeaTiger
l33t
l33t


Joined: 22 Nov 2007
Posts: 603
Location: Toronto, Ontario, Canada

PostPosted: Sun Nov 02, 2008 10:05 am    Post subject: Reply with quote

有沒有試手動執行有沒有問題?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index 中文 (Chinese) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum