Bash Scripting
Matt Alexander
plug-discuss@lists.plug.phoenix.az.us
Sat, 13 Apr 2002 12:50:22 -0700 (PDT)
Oops. Since you're doing an hourly backup, you'll obviously want a more
accurate timestamp than what I provided in my script. The man page for
the date command will give you all the available options. For the hours,
minutes, and seconds, you'll use %H, %M, and %S, respectively.
~M
On 13 Apr 2002, Bryce C. wrote:
> Hi,
> Could anyone give me some help with some bash scripting. I'm trying to
> write a script for an hourly back up but I don't know how to add a
> timestamp in to the tar output file name. What I have currently (with
> confidential parts hidden) is:
>
> #!/bin/bash
> su _USER_ -c "cd /home/_USER_; tar -czf
> _NFSMOUNT_/_FILENAME_._COMPUTERNAME_._DATE_.tar.gz _DIRECTORYTOBU_/"
>
> Anything with _TEXT_ is the ommitted text except for the _DATE_. Anyone
> please?
>
>
>
>
> ________________________________________________
> See http://PLUG.phoenix.az.us/navigator-mail.shtml if your mail doesn't post to the list quickly and you use Netscape to write mail.
>
> PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>