리눅스 분류
cron에 대해서 .....;;
작성자 정보
- 이승환 작성
- 작성일
컨텐츠 정보
- 1,798 조회
- 1 댓글
- 0 추천
- 목록
본문
안녕하세요 ..
/root/root_shell/log_backup.sh 를 만들어서
crontab -e 에 다음과 같이 저장하고 있습니다.
00 00 * * * /usr/bin/apt-get update
10 00 * * * rdate -s time.bora.net && clock -w
20 00 * * * /root/root_shell/log_backup.sh
00 7 * * * /usr/bin/python /root/root_shell/doxygen_schedule.py
문제없이 실행되고 있는데요....
다음은 root/root_shell/밑에 test를 만든 내용 입니다.
#include <stdio.h>
main()
{
FILE *ifp, *ofp;
int ch;
ifp = fopen("/root/root_shell/log_backup.sh", "r");
ofp = fopen("/root/root_shell/log_backup2.sh", "w");
while ((ch=fgetc(ifp)) != EOF)
fputc(ch, ofp);
fclose(ifp);
fclose(ofp);
}
/root/root_shell/test 하면 정상적으로 작동하는데요
cron에 넣으면 ;;; 로그를 보면 실행은 하는데
/root/밑에 log_backup2.sh 를 만드는데 빈 0 byte 파일을 만드네요....
제가 뭘 실수 하고 있는걸까요..? ;;
고수님들의 조언 부탁드립니다...
관련자료
-
이전
-
다음
댓글 1
이승환님의 댓글
- 이승환
- 작성일
아 .. 바보입니다...
처음에 컴파일 할때 파일이
#include <stdio.h>
main()
{
FILE *ifp, *ofp;
int ch;
ifp = fopen("log_backup.sh", "r");
ofp = fopen("log_backup2.sh", "w");
while ((ch=fgetc(ifp)) != EOF)
fputc(ch, ofp);
fclose(ifp);
fclose(ofp);
}
이러했는데요 ... 수정하고 컴파일을 안했습니다..
ㅜ.ㅜ
처음에 컴파일 할때 파일이
#include <stdio.h>
main()
{
FILE *ifp, *ofp;
int ch;
ifp = fopen("log_backup.sh", "r");
ofp = fopen("log_backup2.sh", "w");
while ((ch=fgetc(ifp)) != EOF)
fputc(ch, ofp);
fclose(ifp);
fclose(ofp);
}
이러했는데요 ... 수정하고 컴파일을 안했습니다..
ㅜ.ㅜ