From 7829233bfe5695ea90c5667c2ddb2e4967dd6bd4 Mon Sep 17 00:00:00 2001 From: CaylakPenguen Date: Sat, 15 Feb 2014 06:48:23 +0200 Subject: [PATCH] Bash Betikleri --- cron.sh | 7 +++++++ crontab.txt | 32 ++++++++++++++++++++++++++++++ rsync-mate.sh | 5 +++++ rsync-slack.sh | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 97 insertions(+) create mode 100755 cron.sh create mode 100644 crontab.txt create mode 100755 rsync-mate.sh create mode 100755 rsync-slack.sh diff --git a/cron.sh b/cron.sh new file mode 100755 index 0000000..fa21d44 --- /dev/null +++ b/cron.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# 15 - 02 - 2014 +# cron betiklerini Calistirmak icin Betik. + +$HOME/.bin/rsync-slack.sh + +$HOME/.bin/rsync-mate.sh diff --git a/crontab.txt b/crontab.txt new file mode 100644 index 0000000..d05e51a --- /dev/null +++ b/crontab.txt @@ -0,0 +1,32 @@ +# Edit this file to introduce tasks to be run by cron. +# +# Each task to run has to be defined through a single line +# indicating with different fields when the task will be run +# and what command to run for the task +# +# To define the time you can provide concrete values for +# minute (m), hour (h), day of month (dom), month (mon), +# and day of week (dow) or use '*' in these fields (for 'any').# +# Notice that tasks will be started based on the cron's system +# daemon's notion of time and timezones. +# +# Output of the crontab jobs (including errors) is sent through +# email to the user the crontab file belongs to (unless redirected). +# +# For example, you can run a backup of all your user accounts +# at 5 a.m every week with: +# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/ +# +# For more information see the manual pages of crontab(5) and cron(8) +# +# m h dom mon dow command + +# 5 dakikada bir Calisir. +#00-59/5 * * * * $HOME/bin/rsync-slack.sh + +# Her Saat Basinda Calisir. +#00 * * * * $HOME/.bin/rsync-slack.sh + +# Tum Gorevler icin :-) +00 * * * * $HOME/.bin/cron.sh + diff --git a/rsync-mate.sh b/rsync-mate.sh new file mode 100755 index 0000000..c952f71 --- /dev/null +++ b/rsync-mate.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# 12 - 02 - 2014 CaylakPenguen +rsync -av -h --del --stats \ + --exclude=14.0/* \ + rsync://rsync.slackware.org.uk/msb/ $HOME/iso/Slackware/mateSB/ > $HOME/iso/Slackware/Loglar/rsync-mate-log-`date +%F-%H-%M`.txt diff --git a/rsync-slack.sh b/rsync-slack.sh new file mode 100755 index 0000000..b21bf00 --- /dev/null +++ b/rsync-slack.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# Slackware Yansilama Betigi. +# Caylak Penguen 02 - 02 - 2014 - Pazar +# +# +RSYNC=/usr/bin/rsync +# Yerel Dizin Yolu +LOCALDIR=$HOME/iso/Slackware +# Eşitlenecek Dizin. +TARGETDIR=$LOCALDIR/slackware-current +# Log Dizini +LOGDIR=$LOCALDIR/Loglar +# rsync opsiyonel parametreleri. +#OPSIYON=-avh --stats --del + +echo " Basladi >>> `date`" >>$LOGDIR/date.txt + +# Nereden Yansi alinacak. + +# ftp.slackware.com +# OSUOSL yi Gosteriyor +# RSYNCURL=rsync://ftp.slackware.com + +# Oregon State University - Open Source Lab USA ( Birincil Slackware Resmi Yansi ) +# RSYNCURL=rsync://rsync.osuosl.org +# RSYNCURK=rsync://slackware.osuosl.org + +# Bulgaria Mirrors http://mirrors.unixsol.org (SIk Guncellenmiyor... - 04-02-2012) +# RSYNCURL= rsync://mirrors.unixsol.org + +# Yandex Rusya Mirror +# RSYNCURL=rsync://mirror.yandex.ru + +# Yunanistan (SIk Guncellenmiyor...) +# RSYNCURL=rsync://ftp.cc.uoc.gr + +# Türkiye Linux Kullanıcıları Derneği Sunucusu (SIk Guncellenmiyor... - 04-02-2012) + RSYNCURL=rsync://ftp.linux.org.tr + +# Tam yansi Adresi. Sunucu ve yansılanacak dizin. + SLACKURL=$RSYNCURL/slackware/slackware-current + +# ---------- Main -------------- +# Once Durumu log dosyasina yazsin ;-) +# $RSYNC $RSYNCURL/slackware/ > $LOGDIR/rsync-slackware-log-server-`date +%F-%H-%M`.txt + +# Esitleme Islemi.. + $RSYNC -av -h --stats --del \ + --exclude=source/* \ + --exclude=extra/source/* \ + $SLACKURL/ $TARGETDIR/ > $LOGDIR/rsync-slackware-log-`date +%F-%H-%M`.txt + +echo " Bitti >>> `date`" >>$LOGDIR/date.txt