Articles on: FTP

How to automate FTP file transfers using scripts or task schedulers.

Automating FTP File Transfers with
At, we understand the importance of streamlining file transfer processes for efficient website and application management. One way to achieve this is by automating FTP file transfers using scripts or task schedulers within cPanel. Here's how you can set it up:
Using Scripts
o Create a script file (e.g., in your home directory or a subdirectory.
o Open the script file using a text editor and add the necessary commands for FTP file transfer. For example:
Copy code

Set FTP credentials


Set local and remote directorieLOCAL_DIR="/path/to/local/directory"


Transfer files using FTP

ncftpput -V -u "$FTP_USER" -p "$FTP_PASS" -m "$REMOTE_DIR" "$LOCAL_DIR/*"
• Replace the placeholders (e.g., FTP_HOST, FTP_USER, FTP_PASS, LOCAL_DIR, REMOTE_DIR) with your actual values.
• Save the script file and make it executable by running chmod +x
• You can now run the script manually using ./ or schedule it using a task scheduler.
Using Task Schedulers
o Log in to your cPanel account.
o Navigate to the "Cron Jobs" section under "Advanced" or search for "Cron Jobs" in the cPanel search bar.
o Click on the "Cron Jobs" icon to open the Cron Jobs interface.
o Choose the desired frequency for running the FTP file transfer script (e.g., once a day, once a week, etc.).
o In the command field, enter the path to your script file (e.g., /home/username/
o Click "Add New Cron Job" to save the scheduled task.
By following these steps, you can automate FTP file transfers using scripts or task schedulers in cPanel at This can save you time and effort, ensuring that your files are transferred regularly without manual intervention.
Please note that you may need to adjust the script and cron job settings based on your specific requirements and server configurations. If you encounter any issues or have further questions, feel free to reach out to our support team at for assistance.

Updated on: 08/05/2024

Was this article helpful?

Share your feedback


Thank you!