This article applies to GoodSync for Linux. For instructions on creating a job in GoodSync for Windows or Mac, please click here.
If you haven't already, download and install GoodSync for Linux.
In GoodSync for Linux, job creation is entirely command-line based, as there is no GUI available. Everything starts with the command called gsync. Using gsync /? will provide you with the available commands and options. You can also refer to the corresponding Help Center article for more details on using gsync.
In the example below, we will create an automated backup job with Amazon S3 object storage. To do so, we will need to obtain Amazon S3 access keys.
Follow these steps to create your job:
1) Open a Linux shell (terminal).
2) Use the gsync job-new command to create a new job:
gsync job-new "Backup to S3" /f1=file:///home/user/Data /f2=s3s://s3.amazonaws.com/AWS_BUCKET_NAME/folder /userid2=AWS_ACCESS_KEY_ID /password2=AWS_SECRET_KEY_ID /dir=ltor
Let's review the parameters used:
- "Backup to S3" specifies the name of your job;
- /f1=file:///home/user/Data specifies the Left (source) folder, which is set to the local path "/home/user/Data";
-
/f2=s3://s3.amazonaws.com/AWS_BUCKET_NAME/folder specifies the Right (destination) folder, which is set to Amazon S3, where AWS_BUCKET_NAME is the name of the S3 bucket.
NOTE: The folder path should point to an existing folder. Otherwise, you can add the /create-if-not-found=yes parameter to your job creation command so that GoodSync will create sync folders if these don't exist; - /userid2=AWS_ACCESS_KEY_ID specifies the UserID for the Right folder, where AWS_ACCESS_KEY_ID is the "Access key" of the AWS credentials;
- /password2=AWS_SECRET_ACCESS_KEY_ID specifies the password for the Right folder, where AWS_SECRET_ACCESS_KEY_ID is the "Secret access key" of the AWS credentials;
- /dir=ltor specifies the job direction, which is set to "Backup 1-way Left to Right." Can also be set to "/dir=rtol" (Backup 1-way Right to Left) or "/dir=2way" (Synchronize 2-way).
3) After the job is created, verify it runs manually using the gsync analyze and gsync sync commands:
gsync analyze "Backup to S3"
gsync sync "Backup to S3"
4) To automate the job, update it with the corresponding parameters using the gsync job-update command:
gsync job-update "Backup to S3" /on-schedule=sync /schedule-hour=0,12 /auto-unattended=yes
Let's review the parameters used:
- /on-schedule=sync specifies that you want to run Sync on a schedule.
- /schedule-hour=0,12 specifies the hours on which to run in /on-schedule, setting the job to run every day at 0:00 and 12:00. Should be in 24-hour format.
- /auto-unattended=yes specifies that you want to run your job unattended using GoodSync Runner.
NOTE: For all available Auto options, refer to the article on using gsync.
5) After the job is automated, you can run it using the following command:
gsync /runner
It will execute all unattended jobs according to their Auto options.
To start GoodSync Runner automatically on system boot and run it continuously, you add the gsync /runner command as a cron job.