Hourly
Copy new SFTP files into Drive
New files on your FTP or SFTP server are copied into Drive every hour.
- Runs
- Hourly
- Apps
- Google Drive
- AI
- Not needed
- Access
- write (drive.file)
Send this to your assistant
Create a ClickRuntime automation: every hour, copy any new files from /exports on our SFTP server into my FTP exports Drive folder and email me a list of what was copied.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A logistics coordinator receives daily stock and shipment files from a supplier, who only offers them through an SFTP server. Someone has to log in with a desktop client, work out which files are new since yesterday, download them and re-upload them to the Drive folder the finance team reads from. Miss a day and the reports are wrong, copy a file twice and the totals double up.
Each hour, ClickRuntime connects to the remote folder, lists what is there and skips any file it has already copied, based on state it keeps between runs. New files are downloaded and uploaded into your Drive folder, and when the run finishes you receive an email summary of what was copied.
It fits any team that depends on a partner, bank, ERP export or legacy system that publishes files over FTP or SFTP and that nobody wants to check by hand.
What you get out of it
No file waits a day to be noticed
Hourly copying puts a new supplier export into Drive soon after it appears on the server. Finance and operations can start work in the morning instead of waiting for someone to remember the login.
Duplicates stay out of your reports
Tracking which remote files were already copied prevents the same export from landing twice. Totals in the downstream spreadsheet stay correct, and nobody has to hunt for a doubled-up delivery after the month closes.
Partners keep using their own system
You cannot always ask a supplier to switch tools. Pulling their files from the server they already use keeps the relationship simple while still getting the data into the place your own team works.
A summary of every copy run
The email after each run lists what was transferred, so a missing file is obvious. If a delivery you expected never shows up, you can raise it with the sender the same day.
Less credential sharing
One scheduled job holds the server login as a stored secret, rather than several people keeping the password in a desktop client. Fewer copies of the credentials means fewer places for them to leak.
How it works
What happens, step by step
Every hour ClickRuntime checks the export folder on your file server through its secure web listing.
It skips files it has already copied.
Each new file is downloaded and saved to your Google Drive folder.
You get an email listing the files that were copied.
Before it runs live
- Connect Google Drive
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Run it at a different time, more or less often, or only on weekdays
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other Google Drive steps into one automation
Under the hood
The code that runs this automation
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from googleapiclient.http import MediaInMemoryUpload
from clickruntime import on_trigger, credentials, state, http, notify
# Scripts can only call HTTPS on port 443, so SFTP and FTP are blocked.
# This reads the same export folder through the server's HTTPS file listing.
LISTING_URL = "https://files.example.com/exports/index.json"
FOLDER = "ftp-exports-folder-id"
@on_trigger
def run(event):
auth = ("exports", credentials.secret("EXPORTS_PASSWORD"))
files = http.get(LISTING_URL, auth=auth).json()["files"]
copied = set(state.get("copied") or [])
new = [f for f in files if f["name"] not in copied]
if not new:
return {"copied": 0}
drive = build("drive", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
for f in new:
data = http.get(f"https://files.example.com/exports/{f['name']}", auth=auth).content
drive.files().create(body={"name": f["name"], "parents": [FOLDER]},
media_body=MediaInMemoryUpload(data, "application/octet-stream", resumable=True)).execute()
copied.add(f["name"])
notify.email_me(f"Copied {len(new)} export files to Drive", "\n".join(f["name"] for f in new))
state.set("copied", sorted(copied))
return {"copied": len(new)}FAQ
Common questions
Does it work with both FTP and SFTP?
What happens to files that are very large?
Does it delete files from the FTP server after copying?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Back up your data to Drive every night
Each night your data is saved to a dated Drive folder, and backups older than 30 days go to trash.
See how it worksKeep your uploads folder sorted
New files get a dated name and move into folders by type, and duplicates are reported to you.
See how it worksArchive a website to Drive as Markdown
Each page of a site is saved in Drive as a Markdown file you can read or reuse.
See how it worksKeep exploring
Set up “Copy new SFTP files into Drive” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.