Scheduling File Transfers
Schedule automated file transfers
Schedule file transfers using cron expressions to automate data movement at specific times.
Cron Expression Format
MFT schedules use cron expressions with 6 fields:
seconds minutes hours day-of-month month day-of-week
Example: 0 0 0 * * ? runs daily at midnight (0 seconds, 0 minutes, 0 hours).
Common Scheduling Patterns
Every Hour
schedule: 0 0 * * * ?
Runs at minute 0 of every hour (1:00, 2:00, 3:00, etc.).
Every 15 Minutes
schedule: 0 */15 * * * ?
Runs at 0 seconds of every 15th minute (0, 15, 30, 45).
Daily at Midnight
schedule: 0 0 0 * * ?
Runs once per day at 00:00:00.
Weekdays at 9 AM
schedule: 0 0 9 * * MON-FRI
Runs Monday through Friday at 9:00:00 AM.
Every 2 Hours
schedule: 0 0 */2 * * ?
Runs every 2 hours at minute 0 (0:00, 2:00, 4:00, etc.).
Weekly on Monday
schedule: 0 0 9 * * MON
Runs every Monday at 9:00:00 AM.
Daily at 2 AM
schedule: 0 0 2 * * ?
Runs once per day at 02:00:00.
Every 4 Hours
schedule: 0 */4 * * * ?
Runs every 4 hours at minute 0.
Special Characters
* - Any value Matches any value for the field.
? - No specific value Used in day-of-month or day-of-week when you don’t want to specify one.
- - Range Specifies a range of values.
schedule: 0 0 9 * * MON-FRI # Monday through Friday
, - List Specifies multiple values.
schedule: 0 0 9 * * MON,WED,FRI # Monday, Wednesday, Friday
/ - Increments Specifies incremental values.
schedule: 0 */15 * * * ? # Every 15 minutes
schedule: 0 0 */2 * * ? # Every 2 hours
Scheduling Examples
Hourly Transfer
Transfer files every hour:
apiVersion: weik.io/v1alpha1
kind: MFT
metadata:
name: hourly_logs
spec:
source:
name: app_server_smb
path: logs/
destination:
name: weikio_blob
path: logs/
command: copy
filters: "*.log"
schedule: 0 0 * * * ?
Daily Backup
Run backup at 2 AM daily:
apiVersion: weik.io/v1alpha1
kind: MFT
metadata:
name: nightly_backup
spec:
source:
name: backup_server_smb
path: backups/database/
destination:
name: backup_s3
path: database/
command: copy
filters: "*.sql.gz"
schedule: 0 0 2 * * ?
Business Hours Sync
Sync files every 4 hours during business hours on weekdays:
apiVersion: weik.io/v1alpha1
kind: MFT
metadata:
name: business_hours_sync
spec:
source:
name: company_smb
path: shared/documents/
destination:
name: weikio_blob
path: documents/
command: sync
schedule: 0 0 */4 * * MON-FRI
Weekly Report Transfer
Transfer reports every Monday morning:
apiVersion: weik.io/v1alpha1
kind: MFT
metadata:
name: weekly_reports
spec:
source:
name: company_smb
path: reports/weekly/
destination:
name: partner_sftp
path: incoming/
command: move
filters: "report_*.csv"
schedule: 0 0 9 * * MON
Frequent Monitoring
Transfer monitoring data every 15 minutes:
apiVersion: weik.io/v1alpha1
kind: MFT
metadata:
name: monitoring_data
spec:
source:
name: monitoring_smb
path: metrics/
destination:
name: weikio_blob
path: metrics/
command: copy
filters: "*.json"
schedule: 0 */15 * * * ?
Agent Placement with Requirements
The requirements field controls which agent executes the scheduled transfer. Agents register with specific capabilities, and MFT definitions match agents with compatible requirements.
apiVersion: weik.io/v1alpha1
kind: MFT
metadata:
name: onpremise_to_cloud
spec:
source:
name: company_smb
path: data/
destination:
name: weikio_blob
path: data/
command: copy
schedule: 0 0 0 * * ?
requirements:
Location: OnPremise
Network: internal
Common requirement keys:
Location- Placement (OnPremise, Cloud, Edge)Network- Network access (internal, external, vpn)Environment- Target environment (production, staging, development)Region- Geographic regionDatacenter- Specific datacenter
Agents with matching capabilities will execute the scheduled transfer.
What’s Next
- File Transfer Patterns - Common transfer patterns
- MFT Setup - Create CoreSystems and MFT definitions
- Scheduled Tasks - Advanced scheduling details