You are not logged in.

#1 2010-08-06 21:50:24

ftornell
Member
Registered: 2008-08-18
Posts: 277
Website

[Solved] - Question about the cron. folders

Hi guys,
I was thinking of creating a rsync.sh file with some information that will take backup of some of my folders and send them to another "server".

Do I just need to put the .sh file inside for instance /etc/cron.weekly folder and make it executable by root? or what permission should it have?

thx!

Last edited by ftornell (2010-08-06 22:23:51)


[ logicspot.NET | mempad.org ]
Archlinux x64

Offline

#2 2010-08-06 21:55:38

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved] - Question about the cron. folders

Root can execute anything as long as it's executable: 'chmod +x' should be enough.

Offline

#3 2010-08-06 22:10:35

ftornell
Member
Registered: 2008-08-18
Posts: 277
Website

Re: [Solved] - Question about the cron. folders

Ok, but is just simply to put a file in there and it will be executed every week?
If the computer is down on the monday and will be started on tuesday, will the script be run at tuesday or does it have to be on when the clock turns 00:01 every monday or this will fail?

follow up question; im from the windows world with like .bat and .cmd files...what are ".sh" files?  Do they need to have that extension? good idea? (is it short for shell?)

Last edited by ftornell (2010-08-06 22:10:55)


[ logicspot.NET | mempad.org ]
Archlinux x64

Offline

#4 2010-08-06 22:17:28

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved] - Question about the cron. folders

.sh is a shell script. Most programs don't need file extensions, but sometimes you may get 'error: the file is not a jpg' or sth like that - the file _is_ a .jpg but w/o the jpg extension and the stupid program can't do it's work. The extensions are for you, you can have .script if you like.

Yes, the computer has to be turned on for cron to work. There's anacron - a different type of cron - for computers that are not turned on 24/7.
There may be a way to do this with dcron, but you have to check it for yourself.

Offline

#5 2010-08-06 22:23:31

ftornell
Member
Registered: 2008-08-18
Posts: 277
Website

Re: [Solved] - Question about the cron. folders

Thx for the help! smile


[ logicspot.NET | mempad.org ]
Archlinux x64

Offline

#6 2010-08-06 23:05:39

Stebalien
Member
Registered: 2010-04-27
Posts: 1,237
Website

Re: [Solved] - Question about the cron. folders

See xyne's cronwhip for a simpler solution than anacron: http://xyne.archlinux.ca/projects/cronwhip


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com

Offline

Board footer

Powered by FluxBB