Skip to main content

sync or ftp two folder together in same domain

Comments

9 comments

  • cPanelLauren
    Step 3 would need to be a custom script - most likely something you'd execute through a cron, there's nothing in cPanel that would be able to be triggered when a new file you upload and automate a move. WHM has hookable events but they wouldn't cover this specifically.
    0
  • KimberH
    Thank you for the help. Any thoughts on a ftp service that would auto copy and move files for me.
    0
  • cPanelLauren
    It wouldn't be the FTP service that would be the issue, it'd be triggering the automation and I don't think you'd really want to use FTP to transfer files on the same server to a different location Something like this would search for files of type .mp3 and copy them to a chosen directory: $ find /home/$user/public_html/uploaddir/ -iname '*.mp3' -exec cp {} /home/$user/public_html/copytodir/ \;
    By default, unless you use the -i or -n flag the cp command should overwrite - you would need to call the specific directories here and it would be recursive if there were mp3 files below targeted directory they would also be copied. You can replace the cp command with the mv command in the event you want to just move the files rather than copy them
    0
  • KimberH
    It wouldn't be the FTP service that would be the issue, it'd be triggering the automation and I don't think you'd really want to use FTP to transfer files on the same server to a different location Something like this would search for files of type .mp3 and copy them to a chosen directory: $ find /home/$user/public_html/uploaddir/ -iname '*.mp3' -exec cp {} /home/$user/public_html/copytodir/ \;
    By default, unless you use the -i or -n flag the cp command should overwrite - you would need to call the specific directories here and it would be recursive if there were mp3 files below targeted directory they would also be copied. You can replace the cp command with the mv command in the event you want to just move the files rather than copy them

    Thank you for all your help. This might be a job I have to outsource, I don't understand enough of this. Kim
    0
  • cPanelLauren
    We have a list of system administrators (many of whom have several certifications related to cPanel) that may be able to help should you choose to go that route. You can find them here: System Administration Services
    0
  • KimberH
    Thanks, That is good to know.
    0
  • KimberH
    It wouldn't be the FTP service that would be the issue, it'd be triggering the automation and I don't think you'd really want to use FTP to transfer files on the same server to a different location Something like this would search for files of type .mp3 and copy them to a chosen directory: $ find /home/$user/public_html/uploaddir/ -iname '*.mp3' -exec cp {} /home/$user/public_html/copytodir/ \;
    By default, unless you use the -i or -n flag the cp command should overwrite - you would need to call the specific directories here and it would be recursive if there were mp3 files below targeted directory they would also be copied. You can replace the cp command with the mv command in the event you want to just move the files rather than copy them

    I'd really like to spend the weekend learning before hiring someone. I'm a freelancer with a very small budget. Can you tell me where a code like this would go so I can read on on that. Is it a cron job? $ find /home/$user/public_html/uploaddir/ -iname '*.mp3' -exec cp {} /home/$user/public_html/copytodir/ \;
    0
  • cPanelLauren
    That would be something you'd enter in the CLI - this isn't specific to cPanel but more so specific to Linux. You might want to look at some info on learning Linux if your interest is more so in using bash Home | Linux Journey
    0
  • KimberH
    That would be something you'd enter in the CLI - this isn't specific to cPanel but more so specific to Linux. You might want to look at some info on learning Linux if your interest is more so in using bash
    0

Please sign in to leave a comment.