{"id":1189,"date":"2024-12-22T11:22:16","date_gmt":"2024-12-22T07:22:16","guid":{"rendered":"https:\/\/www.buildingtheitguy.com\/?p=1189"},"modified":"2024-12-24T13:44:17","modified_gmt":"2024-12-24T09:44:17","slug":"automate-your-network-backup-using-python","status":"publish","type":"post","link":"https:\/\/www.buildingtheitguy.com\/index.php\/automate-your-network-backup-using-python\/it-automation\/","title":{"rendered":"Automate your Network Backup using Python"},"content":{"rendered":"\n<p><strong>Scenario<\/strong>: You have multiple IDF in each building in your organization, you don&#8217;t want to do manually take configuration of network switches, you can automate this process by simple steps using python.<\/p>\n\n\n\n<p>To automate weekly backups of the <strong>Juniper or Cisco switch configuration<\/strong> over SSH, you can achieve this using a simple script along with a scheduler (Task Scheduler on Windows or <code>cron<\/code> on Linux). Here&#8217;s a step-by-step guide to setting this up:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Prerequisites<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>SSH Access<\/strong>: Ensure SSH access is set up and you can log in without manual password input by configuring SSH keys. (Make sure that user account has read access to configuration not modify access)<\/li>\n\n\n\n<li>We use <strong>Windows <\/strong>Desktop or Server and <strong>Juniper <\/strong>Switches.<\/li>\n\n\n\n<li><strong>Install Python<\/strong>: Download and install Python from <a href=\"https:\/\/www.python.org\/downloads\/\">https:\/\/www.python.org\/downloads\/<\/a>.<\/li>\n\n\n\n<li><strong>Python and Paramiko<\/strong>: Python installed with the Paramiko library for SSH automation.<\/li>\n\n\n\n<li><strong>Install Paramiko<\/strong>: Open Command Prompt and run:<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\npip install paramiko\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 1: Create Python Script to Backup Configuration<\/strong><\/h3>\n\n\n\n<p>Here&#8217;s a sample script that logs into the switch, runs the <code>show configuration | display set<\/code> command, and saves the output to a file with a timestamp.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport paramiko\nimport time\nfrom datetime import datetime\nimport os\n\n# Device details\nhost = 'YourSwitchIP'         # Replace with your switch IP\nusername = 'YourUsername'   # Replace with your SSH username\npassword = 'YourPassword'   # Replace with your SSH password\nbackup_dir = r'C:\/\/path\/to\/backup'  # Directory to save backups\n\ndef backup_config():\n    # Ensure backup directory exists\n    if not os.path.exists(backup_dir):\n        os.makedirs(backup_dir)\n\n    # Establish SSH connection\n    ssh = paramiko.SSHClient()\n    ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())\n    try:\n        ssh.connect(host, username=username, password=password)\n        print(f&quot;Connected to {host}&quot;)\n        \n        # Open a session\n        session = ssh.invoke_shell()\n        time.sleep(1)\n\n        # Send the command to display configuration in set format\n        session.send(&quot;show configuration | display set | no-more\\n&quot;)\n        time.sleep(5)  # Wait for the output to be fully returned\n\n        # Receive output\n        output = session.recv(65535).decode('utf-8')\n        \n        # Create a timestamped backup file\n        timestamp = datetime.now().strftime(&quot;%Y%m%d_%H%M%S&quot;)\n        backup_file = os.path.join(backup_dir, f&quot;juniper_backup_{host}_{timestamp}.txt&quot;)\n        \n        with open(backup_file, 'w') as file:\n            file.write(output)\n        \n        print(f&quot;Backup saved to {backup_file}&quot;)\n\n    except Exception as e:\n        print(f&quot;An error occurred: {e}&quot;)\n\n    finally:\n        ssh.close()\n\n# Run the backup function\nif __name__ == '__main__':\n    backup_config()\n\n<\/pre><\/div>\n\n\n<p><strong>Step 2: <\/strong>Create Batch File <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n@echo off\nREM Full path to the Python executable\nset PYTHON_PATH=&quot;C:\\Users\\youraccount\\AppData\\Local\\Programs\\Python\\Python313\\python.exe&quot;\n\nREM Full path to the Python script\nset SCRIPT_PATH=&quot;C:\\Path\\To\\YourScript_Switch_autobackup.py&quot;\n\nREM Log file to capture output and errors (optional)\nset LOG_FILE=&quot;C:\\logs\\backup_log.txt&quot;\n\n%PYTHON_PATH% %SCRIPT_PATH% &gt;&gt; %LOG_FILE% 2&gt;&amp;1\n\n<\/pre><\/div>\n\n\n<p class=\"has-text-align-center\">Save this as backupswitchtask.bat<\/p>\n\n\n\n<p><strong>Step 3: Create Task Schedular<\/strong> <strong>to Schedule the Script<\/strong><\/p>\n\n\n\n<p><strong>Open Task Scheduler<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Press <code>Win + R<\/code>, type <code>taskschd.msc<\/code>, and press Enter.<\/li>\n<\/ul>\n\n\n\n<p><strong>Create a New Task<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Click <strong>&#8220;Create Basic Task&#8230;&#8221;<\/strong>.<\/li>\n\n\n\n<li>Name it (e.g., &#8220;Switch Weekly Backup&#8221;) and click <strong>Next<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p><strong>Set the Schedule<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Choose <strong>&#8220;Weekly&#8221;<\/strong> and set your preferred day and time (e.g., every Friday at 9 PM).<\/li>\n\n\n\n<li>Click <strong>Next<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p><strong>Set the Action<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Select <strong>&#8220;Start a Program&#8221;<\/strong> and click <strong>Next<\/strong>.<\/li>\n\n\n\n<li>Browse to the Windows Batch executable file (e.g., <code>C:\\backupswitchtask.bat<\/code>).<\/li>\n<\/ul>\n\n\n\n<p><strong>For Cisco IOS and IOS-XE<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nterminal length 0\nshow running-config\n<\/pre><\/div>\n\n\n<pre class=\"wp-block-verse\">To prevent page breaks (similar to <code>no-more<\/code> in Juniper), you can disable paging with<\/pre>\n\n\n\n<p><strong>For Cisco NX-OS<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nshow running-config | no-more\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\"><strong>Security Considerations<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Use SSH Keys<\/strong>: Instead of storing passwords in the script, consider configuring SSH keys for more secure, password-less authentication.<\/li>\n\n\n\n<li><strong>Restrict Access<\/strong>: Ensure the script and backup files are only accessible by authorized users.<\/li>\n\n\n\n<li><strong>Encryption<\/strong>: Consider encrypting the backup files if they contain sensitive information.<\/li>\n<\/ul>\n\n\n\n<p>This setup should automate your weekly Juniper configuration backups efficiently!<\/p>\n\n\n\n<p class=\"has-text-align-center\"><strong>Final &#8211; Input &amp; Output<\/strong><\/p>\n\n\n<div style=\"min-height: 285px;; \" class=\"ub_image_slider swiper-container wp-block-ub-image-slider\" id=\"ub_image_slider_b9ca5d94-6cd9-456b-b524-b3797d26e5b6\" data-swiper-data='{\"speed\":300,\"spaceBetween\":20,\"slidesPerView\":1,\"loop\":true,\"pagination\":{\"el\": \".swiper-pagination\" , \"type\": \"bullets\", \"clickable\":true},\"navigation\": {\"nextEl\": \".swiper-button-next\", \"prevEl\": \".swiper-button-prev\"}, \"keyboard\": { \"enabled\": true }, \"effect\": \"slide\",\"autoplay\":{\"delay\": 2000},\"simulateTouch\":false}'>\n            <div class=\"swiper-wrapper\"><figure class=\"swiper-slide\">\n                <img decoding=\"async\" src=\"https:\/\/www.buildingtheitguy.com\/wp-content\/uploads\/2024\/12\/Network-Backup-Python.png\" alt=\"\" style=\"height: 250px;; \">\n                <figcaption class=\"ub_image_slider_image_caption\"><\/figcaption>\n            <\/figure><figure class=\"swiper-slide\">\n                <img decoding=\"async\" src=\"https:\/\/www.buildingtheitguy.com\/wp-content\/uploads\/2024\/12\/Task-Schedular-Network-Backup.png\" alt=\"\" style=\"height: 250px;; \">\n                <figcaption class=\"ub_image_slider_image_caption\"><\/figcaption>\n            <\/figure><\/div>\n            <div class=\"swiper-pagination\"><\/div>\n            <div class=\"swiper-button-prev\"><\/div> <div class=\"swiper-button-next\"><\/div>\n        <\/div>","protected":false},"excerpt":{"rendered":"<p>Scenario: You have multiple IDF in each building in your organization, you don&#8217;t want to do manually take configuration of network switches, you can automate this process by simple steps using python. To automate weekly backups of the Juniper or Cisco switch configuration over SSH, you can achieve this using a simple script along with [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1191,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[95,102],"tags":[112,110,109,111,108],"class_list":["post-1189","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-it-automation","category-it-infrastructure","tag-autobackup","tag-cisco","tag-juniper","tag-python","tag-switch-backup"],"featured_image_src":"https:\/\/www.buildingtheitguy.com\/wp-content\/uploads\/2024\/12\/Switch-Auto-backup-using-Python.png","author_info":{"display_name":"Mohamed Asath","author_link":"https:\/\/www.buildingtheitguy.com\/index.php\/author\/asathwebtieradmin\/"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Automate your Network Backup using Python - Building THE IT GUY<\/title>\n<meta name=\"description\" content=\"Learn how to automate your network configuration backups using Python scripts. Simplify network management with step-by-step instructions, code examples, and scheduling tips to securely back up your device configurations automatically.\" \/>\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.buildingtheitguy.com\/index.php\/automate-your-network-backup-using-python\/it-automation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Automate your Network Backup using Python - Building THE IT GUY\" \/>\n<meta property=\"og:description\" content=\"Learn how to automate your network configuration backups using Python scripts. Simplify network management with step-by-step instructions, code examples, and scheduling tips to securely back up your device configurations automatically.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.buildingtheitguy.com\/index.php\/automate-your-network-backup-using-python\/it-automation\/\" \/>\n<meta property=\"og:site_name\" content=\"Building THE IT GUY\" \/>\n<meta property=\"article:published_time\" content=\"2024-12-22T07:22:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-24T09:44:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.buildingtheitguy.com\/wp-content\/uploads\/2024\/12\/Switch-Auto-backup-using-Python.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1162\" \/>\n\t<meta property=\"og:image:height\" content=\"688\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Mohamed Asath\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mohamed Asath\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.buildingtheitguy.com\\\/index.php\\\/automate-your-network-backup-using-python\\\/it-automation\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.buildingtheitguy.com\\\/index.php\\\/automate-your-network-backup-using-python\\\/it-automation\\\/\"},\"author\":{\"name\":\"Mohamed Asath\",\"@id\":\"https:\\\/\\\/www.buildingtheitguy.com\\\/#\\\/schema\\\/person\\\/cce03fcda4c40ccf57ab3844ca707561\"},\"headline\":\"Automate your Network Backup using Python\",\"datePublished\":\"2024-12-22T07:22:16+00:00\",\"dateModified\":\"2024-12-24T09:44:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.buildingtheitguy.com\\\/index.php\\\/automate-your-network-backup-using-python\\\/it-automation\\\/\"},\"wordCount\":333,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.buildingtheitguy.com\\\/index.php\\\/automate-your-network-backup-using-python\\\/it-automation\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.buildingtheitguy.com\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/Switch-Auto-backup-using-Python.png\",\"keywords\":[\"autobackup\",\"cisco\",\"juniper\",\"python\",\"switch backup\"],\"articleSection\":[\"IT Automation\",\"IT Infrastructure\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.buildingtheitguy.com\\\/index.php\\\/automate-your-network-backup-using-python\\\/it-automation\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.buildingtheitguy.com\\\/index.php\\\/automate-your-network-backup-using-python\\\/it-automation\\\/\",\"url\":\"https:\\\/\\\/www.buildingtheitguy.com\\\/index.php\\\/automate-your-network-backup-using-python\\\/it-automation\\\/\",\"name\":\"Automate your Network Backup using Python - Building THE IT GUY\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.buildingtheitguy.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.buildingtheitguy.com\\\/index.php\\\/automate-your-network-backup-using-python\\\/it-automation\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.buildingtheitguy.com\\\/index.php\\\/automate-your-network-backup-using-python\\\/it-automation\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.buildingtheitguy.com\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/Switch-Auto-backup-using-Python.png\",\"datePublished\":\"2024-12-22T07:22:16+00:00\",\"dateModified\":\"2024-12-24T09:44:17+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.buildingtheitguy.com\\\/#\\\/schema\\\/person\\\/cce03fcda4c40ccf57ab3844ca707561\"},\"description\":\"Learn how to automate your network configuration backups using Python scripts. Simplify network management with step-by-step instructions, code examples, and scheduling tips to securely back up your device configurations automatically.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.buildingtheitguy.com\\\/index.php\\\/automate-your-network-backup-using-python\\\/it-automation\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.buildingtheitguy.com\\\/index.php\\\/automate-your-network-backup-using-python\\\/it-automation\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.buildingtheitguy.com\\\/index.php\\\/automate-your-network-backup-using-python\\\/it-automation\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.buildingtheitguy.com\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/Switch-Auto-backup-using-Python.png\",\"contentUrl\":\"https:\\\/\\\/www.buildingtheitguy.com\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/Switch-Auto-backup-using-Python.png\",\"width\":1162,\"height\":688,\"caption\":\"To automate weekly backups of the Juniper or Cisco switch configuration over SSH, you can achieve this using a simple script along with a scheduler (Task Scheduler on Windows or cron on Linux). Here\u2019s a step-by-step guide to setting this up\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.buildingtheitguy.com\\\/index.php\\\/automate-your-network-backup-using-python\\\/it-automation\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.buildingtheitguy.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Automate your Network Backup using Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.buildingtheitguy.com\\\/#website\",\"url\":\"https:\\\/\\\/www.buildingtheitguy.com\\\/\",\"name\":\"Building THE IT GUY\",\"description\":\"Making Everyone&#039;s Life Easier\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.buildingtheitguy.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.buildingtheitguy.com\\\/#\\\/schema\\\/person\\\/cce03fcda4c40ccf57ab3844ca707561\",\"name\":\"Mohamed Asath\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ab17cc6285a5051affe4181f53011c89cc055de9416bcc44b3e2771be318d870?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ab17cc6285a5051affe4181f53011c89cc055de9416bcc44b3e2771be318d870?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ab17cc6285a5051affe4181f53011c89cc055de9416bcc44b3e2771be318d870?s=96&r=g\",\"caption\":\"Mohamed Asath\"},\"description\":\"Turning IT Challenges into Opportunities\",\"sameAs\":[\"https:\\\/\\\/www.buildingtheitguy.com\"],\"url\":\"https:\\\/\\\/www.buildingtheitguy.com\\\/index.php\\\/author\\\/asathwebtieradmin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Automate your Network Backup using Python - Building THE IT GUY","description":"Learn how to automate your network configuration backups using Python scripts. Simplify network management with step-by-step instructions, code examples, and scheduling tips to securely back up your device configurations automatically.","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.buildingtheitguy.com\/index.php\/automate-your-network-backup-using-python\/it-automation\/","og_locale":"en_US","og_type":"article","og_title":"Automate your Network Backup using Python - Building THE IT GUY","og_description":"Learn how to automate your network configuration backups using Python scripts. Simplify network management with step-by-step instructions, code examples, and scheduling tips to securely back up your device configurations automatically.","og_url":"https:\/\/www.buildingtheitguy.com\/index.php\/automate-your-network-backup-using-python\/it-automation\/","og_site_name":"Building THE IT GUY","article_published_time":"2024-12-22T07:22:16+00:00","article_modified_time":"2024-12-24T09:44:17+00:00","og_image":[{"width":1162,"height":688,"url":"https:\/\/www.buildingtheitguy.com\/wp-content\/uploads\/2024\/12\/Switch-Auto-backup-using-Python.png","type":"image\/png"}],"author":"Mohamed Asath","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Mohamed Asath","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.buildingtheitguy.com\/index.php\/automate-your-network-backup-using-python\/it-automation\/#article","isPartOf":{"@id":"https:\/\/www.buildingtheitguy.com\/index.php\/automate-your-network-backup-using-python\/it-automation\/"},"author":{"name":"Mohamed Asath","@id":"https:\/\/www.buildingtheitguy.com\/#\/schema\/person\/cce03fcda4c40ccf57ab3844ca707561"},"headline":"Automate your Network Backup using Python","datePublished":"2024-12-22T07:22:16+00:00","dateModified":"2024-12-24T09:44:17+00:00","mainEntityOfPage":{"@id":"https:\/\/www.buildingtheitguy.com\/index.php\/automate-your-network-backup-using-python\/it-automation\/"},"wordCount":333,"commentCount":0,"image":{"@id":"https:\/\/www.buildingtheitguy.com\/index.php\/automate-your-network-backup-using-python\/it-automation\/#primaryimage"},"thumbnailUrl":"https:\/\/www.buildingtheitguy.com\/wp-content\/uploads\/2024\/12\/Switch-Auto-backup-using-Python.png","keywords":["autobackup","cisco","juniper","python","switch backup"],"articleSection":["IT Automation","IT Infrastructure"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.buildingtheitguy.com\/index.php\/automate-your-network-backup-using-python\/it-automation\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.buildingtheitguy.com\/index.php\/automate-your-network-backup-using-python\/it-automation\/","url":"https:\/\/www.buildingtheitguy.com\/index.php\/automate-your-network-backup-using-python\/it-automation\/","name":"Automate your Network Backup using Python - Building THE IT GUY","isPartOf":{"@id":"https:\/\/www.buildingtheitguy.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.buildingtheitguy.com\/index.php\/automate-your-network-backup-using-python\/it-automation\/#primaryimage"},"image":{"@id":"https:\/\/www.buildingtheitguy.com\/index.php\/automate-your-network-backup-using-python\/it-automation\/#primaryimage"},"thumbnailUrl":"https:\/\/www.buildingtheitguy.com\/wp-content\/uploads\/2024\/12\/Switch-Auto-backup-using-Python.png","datePublished":"2024-12-22T07:22:16+00:00","dateModified":"2024-12-24T09:44:17+00:00","author":{"@id":"https:\/\/www.buildingtheitguy.com\/#\/schema\/person\/cce03fcda4c40ccf57ab3844ca707561"},"description":"Learn how to automate your network configuration backups using Python scripts. Simplify network management with step-by-step instructions, code examples, and scheduling tips to securely back up your device configurations automatically.","breadcrumb":{"@id":"https:\/\/www.buildingtheitguy.com\/index.php\/automate-your-network-backup-using-python\/it-automation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.buildingtheitguy.com\/index.php\/automate-your-network-backup-using-python\/it-automation\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.buildingtheitguy.com\/index.php\/automate-your-network-backup-using-python\/it-automation\/#primaryimage","url":"https:\/\/www.buildingtheitguy.com\/wp-content\/uploads\/2024\/12\/Switch-Auto-backup-using-Python.png","contentUrl":"https:\/\/www.buildingtheitguy.com\/wp-content\/uploads\/2024\/12\/Switch-Auto-backup-using-Python.png","width":1162,"height":688,"caption":"To automate weekly backups of the Juniper or Cisco switch configuration over SSH, you can achieve this using a simple script along with a scheduler (Task Scheduler on Windows or cron on Linux). Here\u2019s a step-by-step guide to setting this up"},{"@type":"BreadcrumbList","@id":"https:\/\/www.buildingtheitguy.com\/index.php\/automate-your-network-backup-using-python\/it-automation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.buildingtheitguy.com\/"},{"@type":"ListItem","position":2,"name":"Automate your Network Backup using Python"}]},{"@type":"WebSite","@id":"https:\/\/www.buildingtheitguy.com\/#website","url":"https:\/\/www.buildingtheitguy.com\/","name":"Building THE IT GUY","description":"Making Everyone&#039;s Life Easier","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.buildingtheitguy.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.buildingtheitguy.com\/#\/schema\/person\/cce03fcda4c40ccf57ab3844ca707561","name":"Mohamed Asath","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ab17cc6285a5051affe4181f53011c89cc055de9416bcc44b3e2771be318d870?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ab17cc6285a5051affe4181f53011c89cc055de9416bcc44b3e2771be318d870?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ab17cc6285a5051affe4181f53011c89cc055de9416bcc44b3e2771be318d870?s=96&r=g","caption":"Mohamed Asath"},"description":"Turning IT Challenges into Opportunities","sameAs":["https:\/\/www.buildingtheitguy.com"],"url":"https:\/\/www.buildingtheitguy.com\/index.php\/author\/asathwebtieradmin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.buildingtheitguy.com\/index.php\/wp-json\/wp\/v2\/posts\/1189","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.buildingtheitguy.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.buildingtheitguy.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.buildingtheitguy.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.buildingtheitguy.com\/index.php\/wp-json\/wp\/v2\/comments?post=1189"}],"version-history":[{"count":4,"href":"https:\/\/www.buildingtheitguy.com\/index.php\/wp-json\/wp\/v2\/posts\/1189\/revisions"}],"predecessor-version":[{"id":1230,"href":"https:\/\/www.buildingtheitguy.com\/index.php\/wp-json\/wp\/v2\/posts\/1189\/revisions\/1230"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.buildingtheitguy.com\/index.php\/wp-json\/wp\/v2\/media\/1191"}],"wp:attachment":[{"href":"https:\/\/www.buildingtheitguy.com\/index.php\/wp-json\/wp\/v2\/media?parent=1189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.buildingtheitguy.com\/index.php\/wp-json\/wp\/v2\/categories?post=1189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.buildingtheitguy.com\/index.php\/wp-json\/wp\/v2\/tags?post=1189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}