[Python] 리눅스 로그 자동 백업 코드
import datetime import os from shutil import copyfile, copystat s = datetime.datetime.now() dir_name = str(s).replace(' ','_') os.mkdir(dir_name) os.chdir(dir_name) for root, dirs, files in os.walk('/var/log'): for f in files: if 'log' in f: src = root + '/' + f copyfile(src, './' + f) copystat(src, './' + f) 리눅스 로그 파일을 자동으로 백업 해주는 코드입니다.
Programming/Python
2018. 10. 15. 16:07
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 풀이
- Programming
- reversing.kr
- HackingCamp
- 17th HackingCamp CTF
- Write-up
- unity2d
- Level 03
- ftz
- 유니티
- Basic RCE
- CodeEngn
- Advance RCE
- Android
- 멘토링
- C#
- Level 04
- wargame
- Level 05
- 안드로이드 멘토링
- Level 01
- c++
- hackerschool
- Reversing
- Level 02
- pwnable
- xcz.kr
- Unity
- 안드로이드
- Level 06
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함