Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #set -x
- LC_ALL=C
- d_o_w=$(date +"%u")
- #mod=$(( $d_o_w % 2 ))
- #echo ${mod}
- #if [ $(( $d_o_w % 2 )) == 0 ]; then
- if [ $(( $d_o_w )) == 6 ] || [ $(( $d_o_w )) == 7 ];then
- echo "Dzis piekny wolny dzien"
- else
- echo "Dzis smutny pracowity dzien"
- fi
- #!/bin/bash
- #set -x
- n_o_file="$1"
- for files in "$n_o_file"*.pdf
- do
- attachments="$attachments -a ${files}"
- done
- for mails in $(cat adresy.txt)
- do
- mail -s "Zapytanie ofertowe" $attachments $mails < tresc.txt
- done
- echo "Wyslane zalaczniki to: "$attachments""
- echo "Wyslana tresc to: "$(cat tresc.txt)""
- echo "Wyslano na adresy: "$(cat adresy.txt)""
- #!/bin/bash
- #set -x
- extension="$1"
- days="$2"
- n_o_tar="$3"
- files=$(find . -name "*.$extension" -mtime -$days)
- tar cvf "$n_o_tar".tar.gz $files
- echo "pliki spakowane do archiwum o nazwie "$n_o_tar".tar.gz"
- #! /bin/bash
- set -x
- c_name=0;
- c_days=0;
- c_n_o_tar=0;
- c_extension=0;
- while getopts ":nmae" OPTION; do
- case $OPTION in
- n)
- name=$OPTARG
- c_name=1
- ;;
- m)
- days=$OPTARG
- c_days=1;
- ;;
- a)
- n_o_tar=$OPTARG
- c_n_o_tar=1;
- ;;
- e)
- extension=$OPTARG
- c_extension=1;
- ;;
- *)
- echo "Błędna opcja"; exit 1;;
- esac
- files=$(find . -name "$name*.$extension" -mtime -$days)
- tar cvf "$n_o_tar".tar.gz $files
- echo "pliki spakowane do archiwum o nazwie "$n_o_tar".tar.gz"
- done
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement