|
Need Help in constructing a script
Am using postfix running on CentOS 5.3. It has the "always_bcc" function enabled for backup of the mails. The "mailbox_size_limit" is set to 1GB.
When this limit for "backup" is reached, the system starts giving error and we transfer the contents of this "backup file" which is /var/spool/mail/backup to some other file and make this as an empty file to start over again.
I need to automate the whole process in the sense that the system should check for the size of /var/spool/mail/backup file every one hour and when the size reaches to 1GB, it should execute the commands as:
service postfix stop
cp /var/spool/mail/backup /home/backup/<some_name>
> /var/spool/mail/backup
service postfix start
I am not having much idea about shell scripting - Can any one help in constructing such a script ?
thanking in advance
rajesh.bahl
|