How to Execute an S3 Sync in the Background with Logging from a .bat File?

0
3
Asked By TechWizard42 On

I'm working with a batch script to perform data migration using the S3 sync command from an on-premises system to Amazon S3. The issue is that when I close the Command Prompt, the migration stops. I need a way to run this batch script in the background so it keeps executing even if the CMD window is closed. Additionally, I want to log the output with timestamps throughout the process. Any suggestions?

4 Answers

Answered By CloudGuru23 On

If you're looking for a more reliable solution, consider using AWS Systems Manager (SSM). You can register your server as a managed instance, allowing you to run the S3 sync using SSM documents. This method allows for execution in the background and on a schedule, plus it provides logging options to CloudWatch, so you’ll have timestamps built-in! It's a great way to handle things without being tied to local execution.

Answered By BatchFileBrawler On

Just to clarify, are you alright using .bat files and still posting on forums like this? Just checking!

Answered By WinCommand45 On

If you're familiar with Linux tools, using tmux or screen can keep processes running in the background. However, that's mostly for Unix-like systems, so for Windows, I recommend sticking to the scheduled task method.

CommandLineNinja -

True, the Windows environment doesn't natively support those tools, so the scheduled task approach is your best bet!

Answered By NightOwl99 On

It sounds like you might want to set up a scheduled task for your batch file instead. This way, it runs independently of whether you're logged in or not. Just configure the scheduled task to run in the background!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.