Skip to content
Landscape Logo for 7 Days Admin Coalition

7 Days to Die Admin Coalition

Resource website for 7 Days to Die from 7DAC discord.

  • Home
  • Server Support
    • Newb FAQ Collection
    • Admin Tools
    • Server Managers
    • Nitrogen
  • Guides
    • Linux
    • Prefabs
  • Modding
    • Modding Resources
    • Modlets
  • Toggle search form
  • Newb FAQ Collection Server
  • HotB Gaming has three 7 Days Serverd Server Adverts
  • Uncategorized
  • Server Donations and the EULA Server
  • How to place a custom prefab in an existing world Prefabs
  • Naza’s Survivors PVE Server Adverts
  • Resolved Issues Support
  • What is a mod? Mods

Automated FTP Backup with Winscp Guide

Posted on June 12, 2021July 14, 2022 By Naz No Comments on Automated FTP Backup with Winscp Guide

Winscp is a file transfer program similar to Filezilla. However it has scripting functionality we can use to set up a automated backup of a remote ftp server.


Step 1 – Install WinSCP

Download and install Winscp. You can find the download link Here


Once installed you can enter your servers ftp details and use it just like filezilla.

You can save the session as a site to easily get back to it by right clicking the tab on the top left and selecting “save session as site” from the dropdown.

Here you also have the option of saving passwords if your scrips stops to ask for a password you can try enabling this checkbox.

To edit a saved site you can right click the tab again and go to “sites > Site manager” from the dropdown.

If you encounter an error along the lines of “error could not get directory” and it doesn’t populate the directory. You can go to the site manger and on the bottom right select “advanced”

Then go to “Connection” on the left and uncheck “passive mode”


Step 3 – Setting up the scrips

Next it’s time to prepare the scrips. In this guide we’re going to use a .bat file to hook into windows task scheduler and a winscp script.txt file to script the backup. I’ll post the example/template scrips to show you how it should look and what does what.
You can either edit and use those or make your own. The .bat is very simple. All it has is 1 line “winscp.exe /console /script=NAMEOFYOURBACKUPSCRIPT.txt” all this does is launch winscp and pass the winscpscript.txt file to the console. You can place this file anywhere but for this guide
i’ll save it inside the winscp directory. C:/Program Files (x86)/WinSCP

.bat File

winscp.exe /console /script=7dtdbackupscript.txt

The next script will tell WinSCP what to do. For simplicity i’ll also save this file to the same directory. I also think it might have to be saved there anyway. If you’re unable to edit the script inside this directory, you can create it outside on the desktop for example and just copy it there when you’re done.
If you’re using the template scrips just replace all the capitalisations with your ftp details. There is also comments explaining everything there.

.txt Script File

# These are comments

option batch abort

option confirm off

# example { open naz@192.168.1.87 /log="C:\winscp.log" /loglevel=0 }

open YOURUSERNAME@FTPIPADDRESS /log="C:\winscp.log" /loglevel=0

#Winscp logs are found in C:\Users\YOURUSERNAME\AppData\Local\Temp by default if enabled (search by date modified or "winscp")

#{Alternate open line that allows you to change file protocol and enable/disable passive mode if needed} open ftp://USERNAME:PASSWORD@FTPIPADDRESS/ -passive=0

# Example { get -speed=1000 "/remoteftp*" "C:\backups\7DTD_Remote_Server_Backup.%TIMESTAMP#yyyy-mm-dd_hh-nn-ss%*" }

get -speed=1000 "/PATH TO THE REMOTE FOLDER YOU WANT TO BACKUP*" "LOCAL PATH YOU WANT TO SAVE THE BACKUPS TO\NAME OF THE BACKUP.%TIMESTAMP#yyyy-mm-dd_hh-nn-ss%*"

# -speed= is in kBps (Kilobyte per second) , 1000= 8 mbps (Megabit per second) or 1 Megabyte per second

exit

Step 4 – Setting up schedules to run the scrips

Once the scrips are all done we can set up the automated part using windows task scheduler. Hit start and search for “task scheduler” hit enter. On the right panel click “create basic task”

Give it a name and description if you want.

Select daily for the trigger. We will fine tune this more later.

we’re going to start a program as an action. For the “program/script” browse to where the simple .bat file is that we created earlier. For “Add Arguments” add this:

/log=c:\path\winscp.log /script=NAMEOFYOURSCRIPT.txt

For “start in” put the path to Winscp: C:\Program Files (x86)\WinSCP


Before we hit finish, check the “open the properties checkbox for this task when i click finish” then hit finish.

Go to the “triggers” tab and edit the daily trigger.

Under the advanced settings towards the bottom check “repeat task every” then type how often in hours to want it to run. Ideally you want a backup every hour, however it will depend how big your saves are and how fast your internet is, also how much space you have available. I added the -speed
option in the script so you can limit the speed to prevent your internet being unusable every couple hours for half an hour etc. I also like to change the start time to 0:00:00 so it will run 12 times everyday with 2 hours etc. Hit ok when your finished.


Step 5 – Test everything works ok

Now you can right click the task and click run. If it’s set up correctly you will see it transferring in a cmd window and it will run on it’s own every x hours depending on what you set it too.


Troubleshooting

If the window pops up and then disappears with nothing happening check the logs found in C:\Users\YOURUSERNAME\AppData\Local\Temp by default if enabled (search by date modified or “winscp”)
the directory paths can be a pain to figure out correctly and rented hosts sometimes save the servers save folders in different places. If you’re not sure where your servers saves are, ask your host and they should be able to tell you.
If you’re still having issues check the winscp docs found Here

If you have everything set up correctly and it still doesn’t work, the issue may be with your hosts ftp server. I had an issue with mine and after talking with their support they managed to fix the issue on their end. So it’s worth shooting them a message if it still won’t cooperate.

Print Friendly, PDF & Email
Server, Tutorials Tags:automated, backup, ftp, remote, script, Server

Post navigation

Previous Post: Hosting CSMM on an Unraid Server.
Next Post: Next Post

Related Posts

  • Prefab Editor Overview Guide Prefabs
  • Prefab Editor: Getting Started Basics Prefabs
  • Newb FAQ Collection Server
  • Linux Server Setup Guide Linux
  • Server Donations and the EULA Server
  • How to place a custom prefab in an existing world Prefabs

More Related Articles

Newb FAQ Collection Server
Server Donations and the EULA Server
How to place a custom prefab in an existing world Prefabs
Prefab Editor: Getting Started Basics Prefabs
Prefab Editor Overview Guide Prefabs
Linux Server Setup Guide Linux

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • (no title)July 20, 2022
  • Automated FTP Backup with Winscp GuideJune 12, 2021
    Winscp is a file transfer program similar to Filezilla. However...

    Read More “Automated FTP Backup with Winscp Guide” »

  • Hosting CSMM on an Unraid Server.January 22, 2021
    So you’ve been hosting your own server and now you’ve...

    Read More “Hosting CSMM on an Unraid Server.” »

  • HotB Gaming has three 7 Days ServerdNovember 17, 2020
    Our 7 Days server is updated to Ravenhearst 7.2.1. We...

    Read More “HotB Gaming has three 7 Days Serverd” »

  • Naza’s Survivors PVEOctober 24, 2020
    – Public Webmap – BM Safety for new players –...

    Read More “Naza’s Survivors PVE” »

  • Server Donations and the EULAAugust 18, 2020
    Recently on the discord there has been questions about receiving...

    Read More “Server Donations and the EULA” »

  • Linux Server Setup GuideApril 23, 2020
    Introduction In this guide we will walk you through the...

    Read More “Linux Server Setup Guide” »

  • Prefab Editor: Getting Started BasicsApril 14, 2020
  • Prefab Editor Overview GuideApril 14, 2020
  • How to place a custom prefab in an existing worldMarch 24, 2020

Join Us On Discord

Brain Drain Podcast

7DAC_LogoMerch-e1602000539704

Featured Images

  • 2018-03-20 (3)
  • 7 Days to Die Screenshot 2019.12.28 – 08.53.20.14
  • 2018-04-29
  • Arena
  • 2019-10-15 (11)
  • Feat Image: Super Carrier From Shore
  • 2019-10-15 (8)
  • Arena 582 West 389 South
  • 2018-12-07 (3)
  • 2018-10-06
  • Desktop Screenshot 2019.12.28 – 08.50.33.51
  • 2018-11-24 (1)

Community Discords

Guppy's Discord

Creators Club

The 7DTD Mod Launcher

  • 7 Days to Die Admin Coalition Website 7DAC
  • Uncategorized
  • Prefab Editor Overview Guide Prefabs
  • Linux Server Setup Guide Linux
  • Resolved Issues Support
  • HotB Gaming has three 7 Days Serverd Server Adverts
  • How to place a custom prefab in an existing world Prefabs
  • What is a mod? Mods

Copyright © 2023 7 Days to Die Admin Coalition.

Powered by PressBook Premium theme