[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Synchronize then delete remote directory using SSH-SFTP program or Linux (Centos) command lines

Posted on 2013-01-10
5
Medium Priority
?
1,131 Views
Last Modified: 2013-01-24
Hello Experts,

I have a PBX system which has very limited capacity for call recording that will not last for more than a week probably.

I'm using WinSCP through SFTP (SSH Based on port 22) at the moment to sync remote folder to my PC,  but I have to do this manually each week to sync the recording folder, then delete its remote contents so the PBX can start recording again.

I would like to know if there's any other application that would schedule Synchronization through SSH - SFTP and then delete the remote directory contents. and incase there's not. is there anyway to do this through Centos command lines? as The PBX has also support to USB external storage and I would also be glad if I could schedule moving the recording folder contents from a directory path into another.

Thanks a lot



Thanks
0
Comment
Question by:Mohammed Hamada
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 40

Accepted Solution

by:
omarfarid earned 1000 total points
ID: 38763097
you can run a crontab job to copy then truncate the file

/usr/bin/cp /path/to/yourfile /path/to/somedir/filename
> /path/to/yourfile

put above two lines in a file, say myscript

make it executable

chmod +x myscript

then run

crontab > mycron

echo '59 23 * * * /path/to/myscript' >> mycron

crontab mycron
0
 
LVL 24

Author Comment

by:Mohammed Hamada
ID: 38763363
Salam Omar,

Would this allow the executable script file to be scheduled for weekly run?
thanks
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 38763387
you can change the last * into the day of week you want like


59 23 * * 0 /path/to/myscript

here 0 is for Sunday or you can put 1 for Monday, 2 for Tue etc.
0
 
LVL 16

Assisted Solution

by:AlexPace
AlexPace earned 1000 total points
ID: 38763994
You could use a Robo-FTP script installed as a service to just download the files as they appear on the remote site.  See: http://kb.robo-ftp.com/script_library/show/69
0
 
LVL 24

Author Closing Comment

by:Mohammed Hamada
ID: 38816018
thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Files go missing when using DFS (Distributed File System) Replication and how to recover them and fix it.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question