{"id":202,"date":"2025-08-07T11:13:20","date_gmt":"2025-08-07T09:13:20","guid":{"rendered":"https:\/\/www.genexio.net\/blog\/?p=202"},"modified":"2025-08-25T19:13:04","modified_gmt":"2025-08-25T17:13:04","slug":"automating-filemaker-backups-to-google-drive-with-python-and-rclone","status":"publish","type":"post","link":"https:\/\/www.genexio.net\/blog\/2025\/08\/07\/automating-filemaker-backups-to-google-drive-with-python-and-rclone\/","title":{"rendered":"Automating FileMaker Backups to Google Drive with Python and Rclone"},"content":{"rendered":"\n<p><br><br>Automating FileMaker Backups to Google Drive with Python and Rclone<br><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Introduction<\/h4>\n\n\n\n<p>In this article, I want to share a real-world solution I developed to automate the backup of FileMaker files (.fmp12) from a Windows Server to Google Drive. The goal was to create compressed, date-stamped archives of all relevant files, upload them efficiently, and keep the process fully logged and monitored. The solution uses Python, Rclone, and optionally 7-Zip.<\/p>\n\n\n\n<p>The script only processes FileMaker files that have already been backed up by FileMaker Server\u2019s internal routine \u2014 not live production files. This ensures maximum safety and avoids interfering with open databases.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">What are FileMaker, Python, Rclone, and 7-Zip?<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>FileMaker<\/strong> is a cross-platform database solution developed by Claris (Apple) used to build custom apps for managing business workflows, with a graphical interface and scripting features.<\/li>\n\n\n\n<li><strong>Python<\/strong> is a high-level programming language ideal for automation and scripting tasks.<\/li>\n\n\n\n<li><strong>Rclone<\/strong> is a command-line tool to sync files with various cloud services including Google Drive.<\/li>\n\n\n\n<li><strong>7-Zip<\/strong> is a powerful open-source file archiver, used to compress large files efficiently and reliably.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Requirements<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Python 3.10+<\/li>\n\n\n\n<li>Rclone configured with access to Google Drive<\/li>\n\n\n\n<li>Optional: 7-Zip for large file handling<\/li>\n\n\n\n<li>SMTP credentials for email notifications<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Main Features<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Daily search for <code>.fmp12<\/code> files in a source directory (and subfolders)<\/li>\n\n\n\n<li>Creation of ZIP files with timestamped filenames<\/li>\n\n\n\n<li>Parallel compression using Python&#8217;s built-in <code>zipfile<\/code> and optionally 7-Zip<\/li>\n\n\n\n<li>Upload to Google Drive in a structured folder (organized by date)<\/li>\n\n\n\n<li>Automatic cleanup of local ZIP files after upload<\/li>\n\n\n\n<li>Email notifications at start and end with full logs<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Core Code Overview<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">1. File Search and Compression<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>from zipfile import ZipFile\nimport os\nfrom datetime import datetime\n\ndef compress_file(filepath, output_folder):\n    filename = os.path.basename(filepath)\n    date_str = datetime.now().strftime(\"%Y-%m-%d_%H-%M\")\n    zip_filename = os.path.join(output_folder, f\"{filename}_{date_str}.zip\")\n    with ZipFile(zip_filename, 'w') as zipf:\n        zipf.write(filepath, arcname=filename)\n    return zip_filename\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">2. Upload to Google Drive<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>import subprocess\n\ndef upload_to_gdrive(local_path, remote_folder):\n    result = subprocess.run(&#91;\"rclone\", \"copy\", local_path, remote_folder], capture_output=True)\n    return result.returncode == 0\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">3. Email Notifications<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>import smtplib\nfrom email.mime.text import MIMEText\n\ndef send_email(subject, body):\n    msg = MIMEText(body)\n    msg&#91;\"Subject\"] = subject\n    msg&#91;\"From\"] = \"backup@yourdomain.com\"\n    msg&#91;\"To\"] = \"you@yourdomain.com\"\n\n    with smtplib.SMTP(\"smtp.gmail.com\", 587) as server:\n        server.starttls()\n        server.login(\"your_email\", \"your_password\")\n        server.send_message(msg)\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Results<\/h4>\n\n\n\n<p>The system has been tested with over 60 <code>.fmp12<\/code> files and worked flawlessly. All files were compressed, uploaded to a daily folder in Google Drive, and removed locally to save space. The process is fully automated and can be scheduled with Task Scheduler.<br><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u2705Example of Log backup report<\/h4>\n\n\n\n<p><strong>Date:<\/strong> 2025-08-06<\/p>\n\n\n\n<p><strong>Total Files Processed:<\/strong> 3<\/p>\n\n\n\n<p><strong>Errors:<\/strong> 0<\/p>\n\n\n\n<p><strong>Target Folder:<\/strong> <code>gdrive:\/bk_rclone\/filemaker_fmp12\/python_backup\/2025-08-06<\/code><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\ud83d\udcc4 Log Summary:<\/h4>\n\n\n\n<p>2025-08-06 20:00:02 &#8211; INFO &#8211; === Inizio backup FileMaker === 2025-08-06 20:00:03 &#8211; INFO &#8211; Trovato file: gestionale_rimec.fmp12 (2.9 GB) 2025-08-06 20:01:12 &#8211; INFO &#8211; Creato archivio ZIP: gestionale_rimec_2025-08-06_20-00.zip 2025-08-06 20:10:15 &#8211; INFO &#8211; Caricato su Drive: gestionale_rimec_2025-08-06_20-00.zip 2025-08-06 20:11:08 &#8211; INFO &#8211; Trovato file: ordini_produzione.fmp12 (1.5 GB) 2025-08-06 20:12:01 &#8211; INFO &#8211; Creato archivio ZIP: ordini_produzione_2025-08-06_20-00.zip 2025-08-06 20:13:56 &#8211; INFO &#8211; Caricato su Drive: ordini_produzione_2025-08-06_20-00.zip 2025-08-06 20:14:01 &#8211; INFO &#8211; File ZIP locali rimossi 2025-08-06 20:14:01 &#8211; INFO &#8211; === Backup COMPLETATO ===<\/p>\n\n\n\n<p>\u2014 <em>Automatic backup script via Python + Rclone<\/em><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Who I Am<\/h4>\n\n\n\n<p>I&#8217;m Genesio, co-owner of a mechanical engineering company in Northern Italy. I work daily with FileMaker, custom software, CNC machines, and production automation. My goal is always to improve processes using reliable and flexible solutions \u2014 and this backup system reflects that philosophy.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Conclusion<\/h4>\n\n\n\n<p>If you use FileMaker and want to automate backups to the cloud, this Python + Rclone solution is efficient, transparent, and fully customizable. Let me know if you&#8217;d like a copy of the full script or if you&#8217;re interested in automating the recovery process as well.<\/p>\n\n\n\n<p><strong>Company Links<\/strong><br>These are the websites of my mechanical production company, where we design and manufacture CNC custom parts and develop automation tools:<\/p>\n\n\n\n<p><a href=\"https:\/\/www.rimecsrl.it\" target=\"_blank\" rel=\"noreferrer noopener\">www.rimecsrl.it<\/a> \u2013 Italian version<\/p>\n\n\n\n<p><a href=\"https:\/\/www.cnccustomparts.net\" target=\"_blank\" rel=\"noreferrer noopener\">www.cnccustomparts.net<\/a> \u2013 English version<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Automating FileMaker Backups to Google Drive with Python and Rclone Introduction In this article, I want to share a real-world solution I developed to automate [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,13],"tags":[],"class_list":["post-202","post","type-post","status-publish","format-standard","hentry","category-python","category-rclone"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Automating FileMaker Backups to Google Drive with Python and Rclone - My blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.genexio.net\/blog\/2025\/08\/07\/automating-filemaker-backups-to-google-drive-with-python-and-rclone\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Automating FileMaker Backups to Google Drive with Python and Rclone - My blog\" \/>\n<meta property=\"og:description\" content=\"Automating FileMaker Backups to Google Drive with Python and Rclone Introduction In this article, I want to share a real-world solution I developed to automate [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.genexio.net\/blog\/2025\/08\/07\/automating-filemaker-backups-to-google-drive-with-python-and-rclone\/\" \/>\n<meta property=\"og:site_name\" content=\"My blog\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-07T09:13:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-25T17:13:04+00:00\" \/>\n<meta name=\"author\" content=\"genexio\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"genexio\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.genexio.net\/blog\/2025\/08\/07\/automating-filemaker-backups-to-google-drive-with-python-and-rclone\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.genexio.net\/blog\/2025\/08\/07\/automating-filemaker-backups-to-google-drive-with-python-and-rclone\/\"},\"author\":{\"name\":\"genexio\",\"@id\":\"https:\/\/www.genexio.net\/blog\/#\/schema\/person\/e293425f2302a3a32a049864bf8cd02a\"},\"headline\":\"Automating FileMaker Backups to Google Drive with Python and Rclone\",\"datePublished\":\"2025-08-07T09:13:20+00:00\",\"dateModified\":\"2025-08-25T17:13:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.genexio.net\/blog\/2025\/08\/07\/automating-filemaker-backups-to-google-drive-with-python-and-rclone\/\"},\"wordCount\":568,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.genexio.net\/blog\/#\/schema\/person\/e293425f2302a3a32a049864bf8cd02a\"},\"articleSection\":[\"python\",\"rclone\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.genexio.net\/blog\/2025\/08\/07\/automating-filemaker-backups-to-google-drive-with-python-and-rclone\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.genexio.net\/blog\/2025\/08\/07\/automating-filemaker-backups-to-google-drive-with-python-and-rclone\/\",\"url\":\"https:\/\/www.genexio.net\/blog\/2025\/08\/07\/automating-filemaker-backups-to-google-drive-with-python-and-rclone\/\",\"name\":\"Automating FileMaker Backups to Google Drive with Python and Rclone - My blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.genexio.net\/blog\/#website\"},\"datePublished\":\"2025-08-07T09:13:20+00:00\",\"dateModified\":\"2025-08-25T17:13:04+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.genexio.net\/blog\/2025\/08\/07\/automating-filemaker-backups-to-google-drive-with-python-and-rclone\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.genexio.net\/blog\/2025\/08\/07\/automating-filemaker-backups-to-google-drive-with-python-and-rclone\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.genexio.net\/blog\/2025\/08\/07\/automating-filemaker-backups-to-google-drive-with-python-and-rclone\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.genexio.net\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Automating FileMaker Backups to Google Drive with Python and Rclone\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.genexio.net\/blog\/#website\",\"url\":\"https:\/\/www.genexio.net\/blog\/\",\"name\":\"My blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.genexio.net\/blog\/#\/schema\/person\/e293425f2302a3a32a049864bf8cd02a\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.genexio.net\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.genexio.net\/blog\/#\/schema\/person\/e293425f2302a3a32a049864bf8cd02a\",\"name\":\"genexio\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/7eda1948b0cb52048b0ce1e60c0e9be821f2ad85632d822bd60187a9793428a6?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7eda1948b0cb52048b0ce1e60c0e9be821f2ad85632d822bd60187a9793428a6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7eda1948b0cb52048b0ce1e60c0e9be821f2ad85632d822bd60187a9793428a6?s=96&d=mm&r=g\",\"caption\":\"genexio\"},\"logo\":{\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/7eda1948b0cb52048b0ce1e60c0e9be821f2ad85632d822bd60187a9793428a6?s=96&d=mm&r=g\"},\"sameAs\":[\"http:\/\/www.genexio.net\/blog\"],\"url\":\"https:\/\/www.genexio.net\/blog\/author\/genexio\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Automating FileMaker Backups to Google Drive with Python and Rclone - My blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.genexio.net\/blog\/2025\/08\/07\/automating-filemaker-backups-to-google-drive-with-python-and-rclone\/","og_locale":"en_GB","og_type":"article","og_title":"Automating FileMaker Backups to Google Drive with Python and Rclone - My blog","og_description":"Automating FileMaker Backups to Google Drive with Python and Rclone Introduction In this article, I want to share a real-world solution I developed to automate [&hellip;]","og_url":"https:\/\/www.genexio.net\/blog\/2025\/08\/07\/automating-filemaker-backups-to-google-drive-with-python-and-rclone\/","og_site_name":"My blog","article_published_time":"2025-08-07T09:13:20+00:00","article_modified_time":"2025-08-25T17:13:04+00:00","author":"genexio","twitter_card":"summary_large_image","twitter_misc":{"Written by":"genexio","Estimated reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.genexio.net\/blog\/2025\/08\/07\/automating-filemaker-backups-to-google-drive-with-python-and-rclone\/#article","isPartOf":{"@id":"https:\/\/www.genexio.net\/blog\/2025\/08\/07\/automating-filemaker-backups-to-google-drive-with-python-and-rclone\/"},"author":{"name":"genexio","@id":"https:\/\/www.genexio.net\/blog\/#\/schema\/person\/e293425f2302a3a32a049864bf8cd02a"},"headline":"Automating FileMaker Backups to Google Drive with Python and Rclone","datePublished":"2025-08-07T09:13:20+00:00","dateModified":"2025-08-25T17:13:04+00:00","mainEntityOfPage":{"@id":"https:\/\/www.genexio.net\/blog\/2025\/08\/07\/automating-filemaker-backups-to-google-drive-with-python-and-rclone\/"},"wordCount":568,"commentCount":0,"publisher":{"@id":"https:\/\/www.genexio.net\/blog\/#\/schema\/person\/e293425f2302a3a32a049864bf8cd02a"},"articleSection":["python","rclone"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.genexio.net\/blog\/2025\/08\/07\/automating-filemaker-backups-to-google-drive-with-python-and-rclone\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.genexio.net\/blog\/2025\/08\/07\/automating-filemaker-backups-to-google-drive-with-python-and-rclone\/","url":"https:\/\/www.genexio.net\/blog\/2025\/08\/07\/automating-filemaker-backups-to-google-drive-with-python-and-rclone\/","name":"Automating FileMaker Backups to Google Drive with Python and Rclone - My blog","isPartOf":{"@id":"https:\/\/www.genexio.net\/blog\/#website"},"datePublished":"2025-08-07T09:13:20+00:00","dateModified":"2025-08-25T17:13:04+00:00","breadcrumb":{"@id":"https:\/\/www.genexio.net\/blog\/2025\/08\/07\/automating-filemaker-backups-to-google-drive-with-python-and-rclone\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.genexio.net\/blog\/2025\/08\/07\/automating-filemaker-backups-to-google-drive-with-python-and-rclone\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.genexio.net\/blog\/2025\/08\/07\/automating-filemaker-backups-to-google-drive-with-python-and-rclone\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.genexio.net\/blog\/"},{"@type":"ListItem","position":2,"name":"Automating FileMaker Backups to Google Drive with Python and Rclone"}]},{"@type":"WebSite","@id":"https:\/\/www.genexio.net\/blog\/#website","url":"https:\/\/www.genexio.net\/blog\/","name":"My blog","description":"","publisher":{"@id":"https:\/\/www.genexio.net\/blog\/#\/schema\/person\/e293425f2302a3a32a049864bf8cd02a"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.genexio.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"https:\/\/www.genexio.net\/blog\/#\/schema\/person\/e293425f2302a3a32a049864bf8cd02a","name":"genexio","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/7eda1948b0cb52048b0ce1e60c0e9be821f2ad85632d822bd60187a9793428a6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/7eda1948b0cb52048b0ce1e60c0e9be821f2ad85632d822bd60187a9793428a6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7eda1948b0cb52048b0ce1e60c0e9be821f2ad85632d822bd60187a9793428a6?s=96&d=mm&r=g","caption":"genexio"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/7eda1948b0cb52048b0ce1e60c0e9be821f2ad85632d822bd60187a9793428a6?s=96&d=mm&r=g"},"sameAs":["http:\/\/www.genexio.net\/blog"],"url":"https:\/\/www.genexio.net\/blog\/author\/genexio\/"}]}},"_links":{"self":[{"href":"https:\/\/www.genexio.net\/blog\/wp-json\/wp\/v2\/posts\/202","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.genexio.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.genexio.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.genexio.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.genexio.net\/blog\/wp-json\/wp\/v2\/comments?post=202"}],"version-history":[{"count":3,"href":"https:\/\/www.genexio.net\/blog\/wp-json\/wp\/v2\/posts\/202\/revisions"}],"predecessor-version":[{"id":206,"href":"https:\/\/www.genexio.net\/blog\/wp-json\/wp\/v2\/posts\/202\/revisions\/206"}],"wp:attachment":[{"href":"https:\/\/www.genexio.net\/blog\/wp-json\/wp\/v2\/media?parent=202"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.genexio.net\/blog\/wp-json\/wp\/v2\/categories?post=202"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.genexio.net\/blog\/wp-json\/wp\/v2\/tags?post=202"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}