{"id":1350,"date":"2017-04-17T18:14:02","date_gmt":"2017-04-17T12:44:02","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=1350"},"modified":"2026-08-18T16:30:30","modified_gmt":"2026-08-18T11:00:30","slug":"python-script-take-backup-folder-amazon-s3-windows","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/python-script-take-backup-folder-amazon-s3-windows\/","title":{"rendered":"Python Script to take backup of folder on amazon s3 &#8211; Windows"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p class=\"isSelectedEnd\">Data backup is a critical part of any IT infrastructure. Whether you are managing personal files, application data, or business documents, maintaining regular backups helps protect against accidental deletion, hardware failures, ransomware attacks, and other unexpected incidents.<\/p>\n<p class=\"isSelectedEnd\">Amazon S3 (Simple Storage Service) is a highly durable, secure, and scalable cloud storage service provided by Amazon Web Services (AWS). By storing backups in Amazon S3, organizations can ensure their data remains accessible and protected from local system failures.<\/p>\n<p class=\"isSelectedEnd\">In this tutorial, we will create a Python script that automatically uploads files from a local Windows folder to an Amazon S3 bucket. The script organizes backups into date-based folders, making it easy to manage historical backups and restore files when required. We will also discuss how to schedule the script to run automatically using Windows Task Scheduler.<\/p>\n<h2>Prerequisites<\/h2>\n<p class=\"isSelectedEnd\">Before proceeding, ensure the following requirements are met:<\/p>\n<h3>1. Windows Machine<\/h3>\n<p class=\"isSelectedEnd\">The script is designed to run on a Windows system.<\/p>\n<h3>2. Python Installation<\/h3>\n<p class=\"isSelectedEnd\">Install Python 3 on your Windows machine and verify the installation:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">python --version<\/code><\/pre>\n<h3>3. AWS Account<\/h3>\n<p class=\"isSelectedEnd\">You need an active AWS account with access to Amazon S3.<\/p>\n<h3>4. S3 Bucket<\/h3>\n<p class=\"isSelectedEnd\">Create an S3 bucket where backups will be stored.<\/p>\n<p class=\"isSelectedEnd\">Example bucket:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">my-backup-bucket<\/code><\/pre>\n<h3>5. IAM User Credentials<\/h3>\n<p class=\"isSelectedEnd\">Create an IAM user with the necessary S3 permissions and obtain:<\/p>\n<ul data-spread=\"false\">\n<li>AWS Access Key ID<\/li>\n<li>AWS Secret Access Key<\/li>\n<\/ul>\n<p class=\"isSelectedEnd\">A sample IAM policy is shown below:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": <span class=\"text-token-text-primary cursor-text rounded-sm\" data-placeholder-token=\"true\">[\n        \"s3:PutObject\",\n        \"s3:GetObject\",\n        \"s3:ListBucket\"\n      ]<\/span>,\n      \"Resource\": <span class=\"text-token-text-primary cursor-text rounded-sm\" data-placeholder-token=\"true\">[\n        \"arn:aws:s3:::my-backup-bucket\",\n        \"arn:aws:s3:::my-backup-bucket\/*\"\n      ]<\/span>\n    }\n  ]\n}<\/code><\/pre>\n<h2>Install Required Python Package<\/h2>\n<p class=\"isSelectedEnd\">Install the AWS SDK for Python (boto3):<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">pip install boto3<\/code><\/pre>\n<p class=\"isSelectedEnd\">Verify installation:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">pip show boto3<\/code><\/pre>\n<h2>Create the Backup Script<\/h2>\n<p class=\"isSelectedEnd\">Create a file named:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">s3backup.py<\/code><\/pre>\n<p class=\"isSelectedEnd\">Add the following code:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">import boto3\nimport os\nfrom datetime import datetime\n\n# AWS Configuration\nAWS_ACCESS_KEY_ID = \"YOUR_ACCESS_KEY\"\nAWS_SECRET_ACCESS_KEY = \"YOUR_SECRET_KEY\"\nAWS_REGION = \"us-east-1\"\n\n# S3 Configuration\nBUCKET_NAME = \"my-backup-bucket\"\n\n# Local Folder to Backup\nSOURCE_DIR = r\"C:\\backup\"\n\n# Create Date-Based Folder\ndate_folder = datetime.utcnow().strftime(\"%Y%m%d\")\n\n# Create S3 Client\ns3 = boto3.client(\n    \"s3\",\n    aws_access_key_id=AWS_ACCESS_KEY_ID,\n    aws_secret_access_key=AWS_SECRET_ACCESS_KEY,\n    region_name=AWS_REGION\n)\n\n# Upload Files\nfor root, dirs, files in os.walk(SOURCE_DIR):\n    for file in files:\n        local_file = os.path.join(root, file)\n\n        # Preserve Folder Structure\n        relative_path = os.path.relpath(local_file, SOURCE_DIR)\n        s3_key = f\"{date_folder}\/{relative_path.replace(os.sep, '\/')}\"\n\n        print(f\"Uploading {local_file}\")\n\n        try:\n            s3.upload_file(local_file, BUCKET_NAME, s3_key)\n            print(f\"Uploaded to s3:\/\/{BUCKET_NAME}\/{s3_key}\")\n        except Exception as e:\n            print(f\"Failed: {e}\")\n\nprint(\"Backup completed successfully.\")<\/code><\/pre>\n<h2>How the Script Works<\/h2>\n<h3>Step 1: Connect to AWS<\/h3>\n<p class=\"isSelectedEnd\">The script creates a connection to Amazon S3 using your IAM credentials.<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">s3 = boto3.client(...)<\/code><\/pre>\n<h3>Step 2: Generate a Date-Based Folder<\/h3>\n<p class=\"isSelectedEnd\">The current date is generated in the format:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">20260818<\/code><\/pre>\n<p class=\"isSelectedEnd\">This helps organize backups by date.<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">date_folder = datetime.utcnow().strftime(\"%Y%m%d\")<\/code><\/pre>\n<h3>Step 3: Scan the Local Directory<\/h3>\n<p class=\"isSelectedEnd\">The script recursively scans all files under:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">C:\\backup<\/code><\/pre>\n<p class=\"isSelectedEnd\">using:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">os.walk()<\/code><\/pre>\n<h3>Step 4: Upload Files to S3<\/h3>\n<p class=\"isSelectedEnd\">Each file is uploaded to the S3 bucket while maintaining the original folder structure.<\/p>\n<p class=\"isSelectedEnd\">Example:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">C:\\backup\\documents\\report.pdf<\/code><\/pre>\n<p class=\"isSelectedEnd\">becomes:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">s3:\/\/my-backup-bucket\/20260818\/documents\/report.pdf<\/code><\/pre>\n<h2>Running the Script<\/h2>\n<p class=\"isSelectedEnd\">Execute the script from PowerShell:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">python s3backup.py<\/code><\/pre>\n<p class=\"isSelectedEnd\">Example output:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">Uploading C:\\backup\\documents\\report.pdf\nUploaded to s3:\/\/my-backup-bucket\/20260818\/documents\/report.pdf\n\nUploading C:\\backup\\images\\logo.png\nUploaded to s3:\/\/my-backup-bucket\/20260818\/images\/logo.png\n\nBackup completed successfully.<\/code><\/pre>\n<h2>Verify Backup in Amazon S3<\/h2>\n<p class=\"isSelectedEnd\">Log in to the AWS Management Console and navigate to:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">Amazon S3 \u2192 Your Bucket<\/code><\/pre>\n<p class=\"isSelectedEnd\">You should see a date-based folder:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">20260818\/<\/code><\/pre>\n<p class=\"isSelectedEnd\">Inside the folder, all files and subdirectories from the source folder will be available.<\/p>\n<h2>Automating Daily Backups<\/h2>\n<p class=\"isSelectedEnd\">Windows Task Scheduler can be used to automate the backup process.<\/p>\n<h3>Step 1: Open Task Scheduler<\/h3>\n<p class=\"isSelectedEnd\">Press:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">Windows + R<\/code><\/pre>\n<p class=\"isSelectedEnd\">and run:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">taskschd.msc<\/code><\/pre>\n<h3>Step 2: Create a New Task<\/h3>\n<p class=\"isSelectedEnd\">Select:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">Create Basic Task<\/code><\/pre>\n<h3>Step 3: Configure Trigger<\/h3>\n<p class=\"isSelectedEnd\">Choose:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">Daily<\/code><\/pre>\n<p class=\"isSelectedEnd\">and specify the desired execution time.<\/p>\n<h3>Step 4: Configure Action<\/h3>\n<p class=\"isSelectedEnd\">Program:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">C:\\Python312\\python.exe<\/code><\/pre>\n<p class=\"isSelectedEnd\">Arguments:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">C:\\scripts\\s3backup.py<\/code><\/pre>\n<h3>Step 5: Save the Task<\/h3>\n<p class=\"isSelectedEnd\">The backup process will now execute automatically every day.<\/p>\n<h2>Best Practices<\/h2>\n<h3>Use IAM Roles and Policies<\/h3>\n<p class=\"isSelectedEnd\">Grant only the required permissions to the backup user.<\/p>\n<h3>Avoid Hardcoding Credentials<\/h3>\n<p class=\"isSelectedEnd\">Instead of storing credentials in scripts, use:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">AWS CLI Credentials File<\/code><\/pre>\n<p class=\"isSelectedEnd\">or<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">IAM Roles<\/code><\/pre>\n<p class=\"isSelectedEnd\">where possible.<\/p>\n<h3>Enable S3 Versioning<\/h3>\n<p class=\"isSelectedEnd\">Versioning provides additional protection against accidental deletions and overwrites.<\/p>\n<h3>Use Lifecycle Policies<\/h3>\n<p class=\"isSelectedEnd\">Configure lifecycle policies to move older backups to:<\/p>\n<ul data-spread=\"false\">\n<li>S3 Standard-IA<\/li>\n<li>S3 Glacier<\/li>\n<li>S3 Glacier Deep Archive<\/li>\n<\/ul>\n<p class=\"isSelectedEnd\">to reduce storage costs.<\/p>\n<h3>Enable Encryption<\/h3>\n<p class=\"isSelectedEnd\">Use:<\/p>\n<ul data-spread=\"false\">\n<li>SSE-S3<\/li>\n<li>SSE-KMS<\/li>\n<\/ul>\n<p class=\"isSelectedEnd\">to protect backup data.<\/p>\n<h2>Alternative Approach: AWS CLI<\/h2>\n<p class=\"isSelectedEnd\">For simple backup requirements, AWS CLI can be used instead of Python.<\/p>\n<p class=\"isSelectedEnd\">Install AWS CLI:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">aws configure<\/code><\/pre>\n<p class=\"isSelectedEnd\">Sync a folder:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">aws s3 sync C:\\backup s3:\/\/my-backup-bucket\/backup\/<\/code><\/pre>\n<p class=\"isSelectedEnd\">Create date-based backups:<\/p>\n<pre dir=\"ltr\"><code dir=\"ltr\">$today = Get-Date -Format \"yyyyMMdd\"\naws s3 sync C:\\backup s3:\/\/my-backup-bucket\/$today\/<\/code><\/pre>\n<p class=\"isSelectedEnd\">AWS CLI is often the preferred choice for straightforward backup tasks because it is easy to configure and maintain.<\/p>\n<div contenteditable=\"false\">\n<hr \/>\n<\/div>\n<h2>Conclusion<\/h2>\n<p class=\"isSelectedEnd\">Amazon S3 provides a secure, scalable, and cost-effective solution for storing backups in the cloud. By combining Python and the AWS SDK, you can automate the process of uploading files from a Windows machine to an S3 bucket while maintaining an organized backup structure based on dates.<\/p>\n<p>This approach not only protects your data from local system failures but also simplifies backup management and recovery. For enterprise environments, additional features such as versioning, lifecycle policies, encryption, and automated scheduling can further enhance reliability and security. Whether you are backing up personal files or critical business data, Amazon S3 offers a dependable platform for long-term data protection and disaster recovery.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Data backup is a critical part of any IT infrastructure. Whether you are managing personal files, application data, or business documents, maintaining regular backups helps protect against accidental deletion, hardware failures, ransomware attacks, and other unexpected incidents. Amazon S3 (Simple Storage Service) is a highly durable, secure, and scalable&hellip; <a href=\"https:\/\/pheonixsolutions.com\/blog\/python-script-take-backup-folder-amazon-s3-windows\/\" class=\"more-link read-more\" rel=\"bookmark\">Continue Reading <span class=\"screen-reader-text\">Python Script to take backup of folder on amazon s3 &#8211; Windows<\/span><i class=\"fa fa-arrow-right\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[291,290,226],"tags":[280,292,324],"class_list":{"0":"post-1350","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-python-script","7":"category-script","8":"category-windows-server","9":"tag-amazon","10":"tag-python","11":"tag-s3","12":"h-entry","14":"h-as-article"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Backup a Folder to Amazon S3 Using Python on Windows<\/title>\n<meta name=\"description\" content=\"Automatically back up a local Windows folder to Amazon S3 using Python.Step-by-step guide with code examples, AWS setup,and scheduled backups\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/pheonixsolutions.com\/blog\/python-script-take-backup-folder-amazon-s3-windows\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Backup a Folder to Amazon S3 Using Python on Windows\" \/>\n<meta property=\"og:description\" content=\"Automatically back up a local Windows folder to Amazon S3 using Python.Step-by-step guide with code examples, AWS setup,and scheduled backups\" \/>\n<meta property=\"og:url\" content=\"https:\/\/pheonixsolutions.com\/blog\/python-script-take-backup-folder-amazon-s3-windows\/\" \/>\n<meta property=\"og:site_name\" content=\"PHEONIXSOLUTIONS\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/PheonixSolutions-209942982759387\/\" \/>\n<meta property=\"article:published_time\" content=\"2017-04-17T12:44:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-08-18T11:00:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2016\/09\/PX2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"3837\" \/>\n\t<meta property=\"og:image:height\" content=\"2540\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@pheonixsolution\" \/>\n<meta name=\"twitter:site\" content=\"@pheonixsolution\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. 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:\\\/\\\/pheonixsolutions.com\\\/blog\\\/python-script-take-backup-folder-amazon-s3-windows\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/python-script-take-backup-folder-amazon-s3-windows\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/0ffa33d73c869faec2d50e79c24e3503\"},\"headline\":\"Python Script to take backup of folder on amazon s3 &#8211; Windows\",\"datePublished\":\"2017-04-17T12:44:02+00:00\",\"dateModified\":\"2026-08-18T11:00:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/python-script-take-backup-folder-amazon-s3-windows\\\/\"},\"wordCount\":661,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#organization\"},\"keywords\":[\"amazon\",\"python\",\"s3\"],\"articleSection\":[\"Python\",\"Script\",\"Windows Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/python-script-take-backup-folder-amazon-s3-windows\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/python-script-take-backup-folder-amazon-s3-windows\\\/\",\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/python-script-take-backup-folder-amazon-s3-windows\\\/\",\"name\":\"How to Backup a Folder to Amazon S3 Using Python on Windows\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2017-04-17T12:44:02+00:00\",\"dateModified\":\"2026-08-18T11:00:30+00:00\",\"description\":\"Automatically back up a local Windows folder to Amazon S3 using Python.Step-by-step guide with code examples, AWS setup,and scheduled backups\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/python-script-take-backup-folder-amazon-s3-windows\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/python-script-take-backup-folder-amazon-s3-windows\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/python-script-take-backup-folder-amazon-s3-windows\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python Script to take backup of folder on amazon s3 &#8211; Windows\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/\",\"name\":\"Pheonix Solutions\",\"description\":\"We Empower Your Business Growth\",\"publisher\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#organization\",\"name\":\"PheonixSolutions\",\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/12\\\/logo.png\",\"contentUrl\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/12\\\/logo.png\",\"width\":454,\"height\":300,\"caption\":\"PheonixSolutions\"},\"image\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/PheonixSolutions-209942982759387\\\/\",\"https:\\\/\\\/x.com\\\/pheonixsolution\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/0ffa33d73c869faec2d50e79c24e3503\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/09bacc0294abee1322a23ab4bc6a0330dd4cb4df707dc9d0b0efeba6c109608b?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/09bacc0294abee1322a23ab4bc6a0330dd4cb4df707dc9d0b0efeba6c109608b?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/09bacc0294abee1322a23ab4bc6a0330dd4cb4df707dc9d0b0efeba6c109608b?s=96&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"http:\\\/\\\/pheonixsolutions.com\\\/blog\"],\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Backup a Folder to Amazon S3 Using Python on Windows","description":"Automatically back up a local Windows folder to Amazon S3 using Python.Step-by-step guide with code examples, AWS setup,and scheduled backups","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:\/\/pheonixsolutions.com\/blog\/python-script-take-backup-folder-amazon-s3-windows\/","og_locale":"en_US","og_type":"article","og_title":"How to Backup a Folder to Amazon S3 Using Python on Windows","og_description":"Automatically back up a local Windows folder to Amazon S3 using Python.Step-by-step guide with code examples, AWS setup,and scheduled backups","og_url":"https:\/\/pheonixsolutions.com\/blog\/python-script-take-backup-folder-amazon-s3-windows\/","og_site_name":"PHEONIXSOLUTIONS","article_publisher":"https:\/\/www.facebook.com\/PheonixSolutions-209942982759387\/","article_published_time":"2017-04-17T12:44:02+00:00","article_modified_time":"2026-08-18T11:00:30+00:00","og_image":[{"width":3837,"height":2540,"url":"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2016\/09\/PX2.png","type":"image\/png"}],"author":"admin","twitter_card":"summary_large_image","twitter_creator":"@pheonixsolution","twitter_site":"@pheonixsolution","twitter_misc":{"Written by":"admin","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/pheonixsolutions.com\/blog\/python-script-take-backup-folder-amazon-s3-windows\/#article","isPartOf":{"@id":"https:\/\/pheonixsolutions.com\/blog\/python-script-take-backup-folder-amazon-s3-windows\/"},"author":{"name":"admin","@id":"https:\/\/pheonixsolutions.com\/blog\/#\/schema\/person\/0ffa33d73c869faec2d50e79c24e3503"},"headline":"Python Script to take backup of folder on amazon s3 &#8211; Windows","datePublished":"2017-04-17T12:44:02+00:00","dateModified":"2026-08-18T11:00:30+00:00","mainEntityOfPage":{"@id":"https:\/\/pheonixsolutions.com\/blog\/python-script-take-backup-folder-amazon-s3-windows\/"},"wordCount":661,"commentCount":0,"publisher":{"@id":"https:\/\/pheonixsolutions.com\/blog\/#organization"},"keywords":["amazon","python","s3"],"articleSection":["Python","Script","Windows Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/pheonixsolutions.com\/blog\/python-script-take-backup-folder-amazon-s3-windows\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/pheonixsolutions.com\/blog\/python-script-take-backup-folder-amazon-s3-windows\/","url":"https:\/\/pheonixsolutions.com\/blog\/python-script-take-backup-folder-amazon-s3-windows\/","name":"How to Backup a Folder to Amazon S3 Using Python on Windows","isPartOf":{"@id":"https:\/\/pheonixsolutions.com\/blog\/#website"},"datePublished":"2017-04-17T12:44:02+00:00","dateModified":"2026-08-18T11:00:30+00:00","description":"Automatically back up a local Windows folder to Amazon S3 using Python.Step-by-step guide with code examples, AWS setup,and scheduled backups","breadcrumb":{"@id":"https:\/\/pheonixsolutions.com\/blog\/python-script-take-backup-folder-amazon-s3-windows\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/pheonixsolutions.com\/blog\/python-script-take-backup-folder-amazon-s3-windows\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/pheonixsolutions.com\/blog\/python-script-take-backup-folder-amazon-s3-windows\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/pheonixsolutions.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Python Script to take backup of folder on amazon s3 &#8211; Windows"}]},{"@type":"WebSite","@id":"https:\/\/pheonixsolutions.com\/blog\/#website","url":"https:\/\/pheonixsolutions.com\/blog\/","name":"Pheonix Solutions","description":"We Empower Your Business Growth","publisher":{"@id":"https:\/\/pheonixsolutions.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/pheonixsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/pheonixsolutions.com\/blog\/#organization","name":"PheonixSolutions","url":"https:\/\/pheonixsolutions.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/pheonixsolutions.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2016\/12\/logo.png","contentUrl":"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2016\/12\/logo.png","width":454,"height":300,"caption":"PheonixSolutions"},"image":{"@id":"https:\/\/pheonixsolutions.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/PheonixSolutions-209942982759387\/","https:\/\/x.com\/pheonixsolution"]},{"@type":"Person","@id":"https:\/\/pheonixsolutions.com\/blog\/#\/schema\/person\/0ffa33d73c869faec2d50e79c24e3503","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/09bacc0294abee1322a23ab4bc6a0330dd4cb4df707dc9d0b0efeba6c109608b?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/09bacc0294abee1322a23ab4bc6a0330dd4cb4df707dc9d0b0efeba6c109608b?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/09bacc0294abee1322a23ab4bc6a0330dd4cb4df707dc9d0b0efeba6c109608b?s=96&r=g","caption":"admin"},"sameAs":["http:\/\/pheonixsolutions.com\/blog"],"url":"https:\/\/pheonixsolutions.com\/blog\/author\/admin\/"}]}},"jetpack_shortlink":"https:\/\/wp.me\/p7F4uM-lM","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1350","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=1350"}],"version-history":[{"count":1,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1350\/revisions"}],"predecessor-version":[{"id":10882,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1350\/revisions\/10882"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1350"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1350"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}