How to copy files from one folder to another folder
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Kottapally_Ramesh
7 - Meteor
‎11-29-2021
09:30 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I need take backup of few files everyday.
I have to copy few selected files everyday from one folder and create a new folder with current date (YYYY_MM_DD) and paste those files in this new folder.
Could someone help me how can i achieve this ...
Labels:
2 REPLIES 2
21 - Polaris
‎11-29-2021
10:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
amirsemsar
8 - Asteroid
‎02-20-2023
10:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Alternatively you can use python with a function like this:
from ayx import Alteryx
import shutil
import os
import pandas as pd
def archiving(a):
source=a['filepath'].tolist()
destination=a['destination'].iloc[0]
destination=destination.replace('\\','/')
source=[shutil.copy(each,destination) for each in source]
dicty={"newfiles":[destination+os.path.basename(each) for each in source]}
output=pd.DataFrame.from_dict(dicty)
Alteryx.write(output,1)
df=Alteryx.read("#1")
archiving(df)
