setup cron job to copy files

sorry i am very new to linux but need to copy files from one directory to another  every other day @ 1830

the cp command i have work out is

cp -f /var/www/html/admin/modules/core/etc/* /home/support

how do i create a cron to do this
LVL 31
James MurrellProduct SpecialistAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

fosiul01Commented:
to create a cron job you need to type

contab -e

then

have to give time when you want to copy .

0 22 * * 0 cp -f /var/www/html/admin/modules/core/etc/* /home/support

it wil copy your files at 10  pm every day

just chagne the type to test as your need


0
omarfaridCommented:
to add a crontab job, run

EDITOR=vi
export EDITOR
crontab -e

the above will give you temp file to edit using vi editor (with your current crontab jobs, if any)

add line similar to

30 18 */2 * * /usr/bin/cp -f /var/www/html/admin/modules/core/etc/* /home/support

save and quit
add the line t
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
James MurrellProduct SpecialistAuthor Commented:
add the line t ???
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

omarfaridCommented:
sorry, it is typo (cut and paste problem)
0
fosiul01Commented:
HI
sorry

i just realized my answer was not fully correct because i didnot add /usr/bin before cp

anyway, just a quick add: if you use /usr/bin cp -f  : it might not work because some time cp command is attached with only /bin directory.

to find out where is cp : whereis cp  

thanks
0
James MurrellProduct SpecialistAuthor Commented:
cheers that was a life saver
0
Deepak KosarajuDevOps EngineerCommented:
set the cron job under /etc/crontab as
30 18 */2 * *  /bin/cp -f /var/www/html/admin/modules/core/etc/* /home/support
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.