Solved

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

Posted on 2013-01-10
5
1,101 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
  • 2
  • 2
5 Comments
 
LVL 40

Accepted Solution

by:
omarfarid earned 250 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 23

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 250 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 23

Author Closing Comment

by:Mohammed Hamada
ID: 38816018
thanks
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
wifi not working on Raspberry Pi 3? 2 56
Linux VM 6 89
ifconfig 4 46
number in printf 13 27
Cloud file services can fill many different roles for your business. Often, the use of cloud file services begins with employees using consumer products, like Dropbox, to share files with customers and each other. While sync-and-share can be an effe…
Outsource Your Fax Infrastructure to the Cloud (And come out looking like an IT Hero!) Relative to the many demands on today’s IT teams, spending capital, time and resources to maintain physical fax servers and infrastructure is not a high priority.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

777 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