Skip to content

A syncronizer between a localfolder and a remote folder made in Python

Notifications You must be signed in to change notification settings

wildiney/py-sync-ftp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SyncFtp

A synchronizer between a localfolder and a remote folder

Example of use

If you want to always get files from ftp:

  • Create file syncme.pyw and start the application with the code bellow changing the informations with your real info.
from sync_ftp import SyncFtp

SYNC = SyncFtp("ftphost", "login", "password")
while True:
    SYNC.send_to_ftp("/locafolder/to/sync/", "remotefolder/to/sync")
    time.sleep(60 * 10) # 60 segundos * 10 = 10 minutos

Or a little bit smarter

import time
import config
from sync_ftp import SyncFtp

syncronizing = input("Would you like to start your synchronization? (y/n): ")
if syncronizing == "y":
    SYNC = SyncFtp("ftphost", "login", "password")
    getorput = input("Should I get files from FTP or put files on FTP (g/p): ")
    if getorput == "g" or getorput=="get":
        SYNC.get_from_ftp("D:\\syncfolder", "/syncfolder/")
    if getorput == "p" or getorput=="put":
        continuous = input("Should I continue to syncing your files? (y/n): ")
        if continuous == "y":
            while True:
                SYNC.send_to_ftp("/locafolder/to/sync/", "remotefolder/to/sync")
                time.sleep(60 * 10)

About

A syncronizer between a localfolder and a remote folder made in Python

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages