SQL Server 2008 backup script
It is not possible, because you cannot create a backup of an offline database.

From MSDN:


  Without the NO_TRUNCATE option, the database must be in the ONLINE
  state. If the database is in the SUSPENDED state, you might be able to
  create a backup by specifying NO_TRUNCATE. But if the database is in
  the OFFLINE or EMERGENCY state, BACKUP is not allowed even with
  NO_TRUNCATE