Hi,
No it is not working.
I copied the code in the backup.sh file and put into /etc/cron.hourly
-------------------------------------------
#!/bin/sh
target=$HOME/org/backupOrg
mkdir -p "$target" && \
find "$HOME" -type f -name '*.org' ! -path "$target/*" \
-exec cp -t "$target" {} +
echo "Daily Org Files Backup Successful: $(date)" >>
/home/USERNAME/mybackupOrg.log
-------------------------------------------
And then changed the crontab hourly setting to 26.
/etc/crontab
# m h dom mon dow user command
26 * * * * root cd / && run-parts --report /etc/cron.hourly
-------------------------------------------
Even after 26th minute, there is no sign of the code in work. Is it that
$HOME is not allowed and I need to give full path ?
Thanks
-----------------------------
*Sanjib Sikder
*Ph.D. Fellow
Chemical Engineering
IIT Bombay*
*
On Thu, Oct 18, 2012 at 12:11 AM, Teemu Likonen <[email protected]> wrote:
> Sanjib Sikder [2012-10-17 23:55:12 +0530] wrote:
>
> > #!/bin/bash
> >
> > mkdir -p /home/USERNAME/org/backup && \
> > find $HOME -type f -name '*\.org' ! -path "/home/USERNAME/org/backup/*" \
> > -exec cp -t /home/USERNAME/org/backup/ \{\} \;
>
> How about this:
>
>
> #!/bin/sh
>
> target=$HOME/org/backup
> mkdir -p "$target" && \
> find "$HOME" -type f -name '*.org' ! -path "$target/*" \
> -exec cp -t "$target" {} +
>