import datetime
def get_a_week(start)
date = datetime.datetime(start)
dates = []
for i in range(7):
date += datetime.timedelta(days=1)
print(date)
dates.append(date)
return dates
7_days = get_a_week('2022-09-01')
I need to periodically download files from remote machine, and part of the file name is a date, such as:
file_20220901
Each time I want to download 7 files for seven sequential days, so I need to use a logic like above to download files. How to covert this python code above into a shell script? It will download files using this command:
rsync x.x.x.x::user2/workspace/waic/tag/data/tag.20220901 data