Commit feb3388c authored by liul's avatar liul
Browse files

first commit

parents
1 merge request!1first commit
Showing with 109 additions and 0 deletions
+109 -0
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10 (base)" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/BackupTaiWanData.iml" filepath="$PROJECT_DIR$/.idea/BackupTaiWanData.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
import time
import os
import shutil
fb_post_dir = '/data/bak/osData/POST/TIANGUANG/'
fb_account_dir = '/data/bak/osData/ACCOUNT/TIANGUANG/'
fb_friend_dir = '/data/bak/osData/FRIEND/TIANGUANG/'
fb_bak_dir = '/data/taiwan/facebook/'
if not os.path.exists(fb_bak_dir):
os.makedirs(fb_bak_dir)
#backup facebook post file
if os.path.exists(fb_post_dir):
fb_post_file_list = sorted(os.listdir(fb_post_dir))
for post_file_name in fb_post_file_list:
if post_file_name.startswith('DATA_FACEBOOK_POST_2_014_') and len(post_file_name)>33:
file_date = post_file_name[25:33]
# print('file name:' + post_file_name + ', file date:' + file_date)
post_file_bak_dir = fb_bak_dir + file_date + '/post/'
if not os.path.exists(post_file_bak_dir):
os.makedirs(post_file_bak_dir)
shutil.move(fb_post_dir+post_file_name, post_file_bak_dir)
#backup facebook account file
if os.path.exists(fb_account_dir):
fb_account_file_list = sorted(os.listdir(fb_account_dir))
for account_file_name in fb_account_file_list:
if account_file_name.startswith('DATA_FACEBOOK_ACCOUNT_2_014_') and len(account_file_name)>36:
file_date = account_file_name[28:36]
# print('file name:' + account_file_name + ', file date:' + file_date)
account_file_bak_dir = fb_bak_dir + file_date + '/account/'
if not os.path.exists(account_file_bak_dir):
os.makedirs(account_file_bak_dir)
shutil.move(fb_account_dir+account_file_name, account_file_bak_dir)
#backup facebook friend file
if os.path.exists(fb_friend_dir):
fb_friend_file_list = sorted(os.listdir(fb_friend_dir))
for friend_file_name in fb_friend_file_list:
if friend_file_name.startswith('DATA_FACEBOOK_FRIEND_2_014_') and len(friend_file_name)>35:
file_date = friend_file_name[27:35]
# print('file name:' + friend_file_name + ', file date:' + file_date)
friend_file_bak_dir = fb_bak_dir + file_date + '/friend/'
if not os.path.exists(friend_file_bak_dir):
os.makedirs(friend_file_bak_dir)
shutil.move(fb_friend_dir+friend_file_name, friend_file_bak_dir)
main.py 0 → 100644
# 这是一个示例 Python 脚本。
# 按 Shift+F10 执行或将其替换为您的代码。
# 按 双击 Shift 在所有地方搜索类、文件、工具窗口、操作和设置。
def print_hi(name):
# 在下面的代码行中使用断点来调试脚本。
print(f'Hi, {name}') # 按 Ctrl+F8 切换断点。
# 按间距中的绿色按钮以运行脚本。
if __name__ == '__main__':
print_hi('PyCharm')
# 访问 https://www.jetbrains.com/help/pycharm/ 获取 PyCharm 帮助
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment