Transfer specific sub-directory from cpanel file to box.com via ftp/CRON

conticreative

Registered
Mar 1, 2022
3
1
3
California USA
cPanel Access Level
Root Administrator
We have a quite sudden need to mirror a folder in one of our websites in Box.com.
I was thinking of a small program, triggered by a CRON job to move the directory and its content to Box.com via FTP every X hours.
The directory contains PDF applications that are uploaded to the server by our contractors.

The files should not be archived. The script should run directly on the server. Right now we have a sync program that does the job, but it needs a PC to work from and the PC needs to be turned on. We need to take the PC out of the equation.

Is there any ready-made script PHP or otherwise, that could accomplish this (assuming the proper credentials and API keys are obtained)?
I found mentions to a JAVA 7 script but we have no one that could even begin to set anything in JAVA. PHP we can handle but it would need to be some kind of Open Source program we can install.

Is there some other way we could mirror the contents of this directory on Box.com enterprise?

Thank you.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
10,360
1,628
363
cPanel Access Level
Root Administrator
Hey there! This would ultimately depend on what is available to you on the box.com server. This sounds like a perfect job for rsync, assuming that user has shell access enabled on their account, as that command is available to all users, but I can't say how box.com is set up.

If you can get me more details on how you currently put the files on box.com, such as if you are connecting with an FTP user or some other type of tool, that would be the key to seeing what options are available.
 

conticreative

Registered
Mar 1, 2022
3
1
3
California USA
cPanel Access Level
Root Administrator
Thank you for the reply. We are still waiting for Box.com to let us know how they are setup at their end. They seem to have understood that we want to do a one time "push" of our files, while we need to run a CRON to push new files every hour or so. I am hoping as soon as we clarify that to have better idea of how it works at their end.
 
  • Like
Reactions: cPRex

conticreative

Registered
Mar 1, 2022
3
1
3
California USA
cPanel Access Level
Root Administrator
Box.com has a fairly primitive FTP access: server name, username, password and port number for FTP and encrypted FTP.
https://support.box.com/hc/en-us/articles/360043697414-Using-Box-with-FTP-or-FTPS
I am not familiar with rsync, but that's what google is for. We have a VPS so it's not a shared account. If we need to install something we should be able to.
I am looking into all this but if anyone has any bright ideas, I'll take anything I can.
Thank you again.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
10,360
1,628
363
cPanel Access Level
Root Administrator
Great - that's what we need to know. If FTP is the only answer, you'll have to stick with that, so rsync wouldn't be an option.

There are some details about making an FTP script toward the end of the page here: